Please can someone help me on a code to draw Circle,regtangle on a picturebox. and the item drawn should not clear when i minimize the form
Drawing On A PictureBox
Page 1 of 14 Replies - 4645 Views - Last Post: 23 November 2010 - 12:30 PM
Replies To: Drawing On A PictureBox
#2
Re: Drawing On A PictureBox
Posted 23 November 2010 - 05:38 AM
#3
Re: Drawing On A PictureBox
Posted 23 November 2010 - 07:11 AM
Those are good examples and there are many out there - especially if you name the object you want to use in your search. As for keeping the things you draw, you must provide a collection of that and iterate it in the paint event. I use custom objects and a List(Of <thatobject>) for this purpose. The pain event wipes the slate clean every time it is called - why you see the lines disappear with minimaize(causes the paint event to fire).
#4
Re: Drawing On A PictureBox
Posted 23 November 2010 - 11:38 AM
Thanks For The Posting Brothers. I dont want to draw automatically from within code, I want to use my mouse events and draw the shapes as if am picking a button from toolbox and drawing it on the form
#5
Re: Drawing On A PictureBox
Posted 23 November 2010 - 12:30 PM
onlinespec, on 23 November 2010 - 05:33 AM, said:
...and the item drawn should not clear when i minimize the form
So if you want to only draw them in the mouseevents they will not persist. A variable or collection is the only way to make it persist and this occurs when we repaint(refresh/invalidate the region/control). If you only need 1 object then a variable will do, you can make a boolean for when to show or hide it.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|