Draw a Point
-
I had seen many codes that is used to draw Lines, circles etc, but i like to plot a x,y point in my screen. Can any one please tell me the function to draw a point in screen. Is it needed to convert the point to System coordinates???
Proud To Be an Indian
-
I had seen many codes that is used to draw Lines, circles etc, but i like to plot a x,y point in my screen. Can any one please tell me the function to draw a point in screen. Is it needed to convert the point to System coordinates???
Proud To Be an Indian
You can use the CDC::Ellipse function for that.
vivekphlp wrote:
Is it needed to convert the point to System coordinates???
What do you mean by that ? What is System coordinates ? Are you drawing some kind of chart ? If yes, then of course you need to make a conversion between the point value and the position on the screen (this relation is done using the axes of your chart). You can also take a look at my sig, I developped such a chart control, so it might be usefull for you.
Cédric Moonen Software developer
Charting control [v1.3] -
I had seen many codes that is used to draw Lines, circles etc, but i like to plot a x,y point in my screen. Can any one please tell me the function to draw a point in screen. Is it needed to convert the point to System coordinates???
Proud To Be an Indian
SetPixel()
?nave [OpenedFileFinder]
-
You can use the CDC::Ellipse function for that.
vivekphlp wrote:
Is it needed to convert the point to System coordinates???
What do you mean by that ? What is System coordinates ? Are you drawing some kind of chart ? If yes, then of course you need to make a conversion between the point value and the position on the screen (this relation is done using the axes of your chart). You can also take a look at my sig, I developped such a chart control, so it might be usefull for you.
Cédric Moonen Software developer
Charting control [v1.3] -
SetPixel()
?nave [OpenedFileFinder]
-
I have a CPoint & would like to draw that point on my screen. How can i convert my points to system coordinates.
Proud To Be an Indian
Replying to my question would help a lot to answer yours :rolleyes:
Cédric Moonen Software developer
Charting control [v1.3] -
If the point that you want to draw have a dimension of only one pixel, then changing the color of the specified pixel( say to black color ) will make that pixel to appear as a point isnt it? if the diameter of the point you want is more than a pixel, you have to follow the way mentioned by Cedric Moonen.
nave [OpenedFileFinder]
-
Replying to my question would help a lot to answer yours :rolleyes:
Cédric Moonen Software developer
Charting control [v1.3] -
I have a point say (x,y) i just want to draw it in my window.. just to see where that point is. .
Proud To Be an Indian
What's this conversion you're talking about then ? When you are drawing on a window, all the coordinates are relative to the upper-left corner of the client area of your window.
Cédric Moonen Software developer
Charting control [v1.3] -
I have a point say (x,y) i just want to draw it in my window.. just to see where that point is. .
Proud To Be an Indian
If you use a window device context then pixel coords are relative to the top-left corner of that window client area. On the other hand, if you use a screen device context (for instance via
GetDC(NULL)
) then the pixel coords are relative to top-left corner of the screen. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke