如何在C ++图形窗口中绘制磁盘(圆角)? [英] How Do I Draw Disks(Rounded ) in C++ Graphics Window?

查看:61
本文介绍了如何在C ++图形窗口中绘制磁盘(圆角)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C ++编写了一个程序。这个程序实现了河内难题塔,其中我们有三个塔和一些磁盘。



这个难题的目标是移动整个堆栈(磁盘) )从第一座塔到另一座塔,遵守游戏规则。



我使用rectangle()表示磁盘;功能。但我想将磁盘显示为圆形磁盘,而不是矩形。在graphics.h库中是否有内置函数来绘制圆形磁盘?



我正在使用dev C ++

I have made a program using C++. This program implements "tower of hanoi puzzle" in which we have three towers and a number of disks.

The objective of the puzzle is to move the entire stack(disks) from first tower to another tower, obeying the rules of the game.

I represented the disks using rectangle(); function. But I want to show the disks as rounded disk, not as a rectangle. Is there a built in function in "graphics.h" library to draw a rounded disk??

I am using dev C++

推荐答案

检查文档通常是最好的方法。大多数图形库使用椭圆类型来绘制圆圈。
Checking the documentation is usually the best way to find out. Most graphics libraries use the ellipse type to draw circles.


这篇关于如何在C ++图形窗口中绘制磁盘(圆角)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆