Dot marking, region restriction and get coordinate problem

retkehing

Well-known member
Joined
Feb 5, 2006
Messages
153
Programming Experience
Beginner
I need the GDI+ code for marking a dot on certain portion of form? In other words, I want to define a width and height of form portion for marking dot, and finally i wanna get the dot x and y coordinte, I need the command for getting coordinate. For example, mark two dots on the defined form portion and retrieve the x, y coordinate for both dots in order for distance calculation between these dots. Besides that, how to restrict a region for marking dots?

I used DrawingGraphics.FillEllipse(DrawingBrush, 30, 100, 5, 5) to draw a circle and in fact it was expected to be a dot due to its size, however, when I put the value to 5, 5, it appeared as a square instead of circle and this was solved with larger values. Hence, any other ways can be used to maintain the values with the proper appearance of the shape. How to trigger an event such as marking a dot on the form?
 
Last edited:
When you store Point objects in ArrayList, you can retrieve the objects from ArrayList as Points. X and Y is two of the properties of a Point.
VB.NET:
Dim somepoint as Point = DirectCast(points.item(1), Point)
msgbox(somepoint.X)
msgbox(somepoint.Y)
 
Back
Top