hey guys !! I am new to graphics in c++ . the question says that your code should facilitate the user to draw different shapes using a mouse . for example if i have to draw a circle then how should i get started ?

4 Years
Discussion Span
Last Post by Ketsuekiame

What GUI toolset are you using?

Most GUI toolset will have a kind of "Canvas" widget which usually has functions for adding shapes like circles, rectangles, lines, text, etc... more or less everything you need to create a simple "Paint" application.

For example, using Qt, there is a framework of classes grouped under Graphics View Framework that will provide all the functionality that you need. They have examples and tutorials available.

As for other toolsets (WinForms, MFC, WxWidget, GTK+, VCL, etc.), I'm less familiar with them, but I'm sure they have similar functionality, often under a name like "GraphicsView" or "Canvas".


What does it say in the course material you've been studying?

To start, i'd capture the mouse position from the moment you receive a mouse down message to the moment you receive the mouse up message and plotting that in data points. You can then either display or translate these points.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.