A Paint like application
-
Hello friends.. I came accross a small problem. I need to draw something e.g. rectangles, circles, ellipses ,etc. I read the articles and learnt how to draw them , but as we can see the rectangle with a broken border as in paint until and unless we release the mouse , I am unable to do such in my application... Please help...
-
Hello friends.. I came accross a small problem. I need to draw something e.g. rectangles, circles, ellipses ,etc. I read the articles and learnt how to draw them , but as we can see the rectangle with a broken border as in paint until and unless we release the mouse , I am unable to do such in my application... Please help...
Dude, I think you need to rephrase that. I really can't understand what you want to say.
Regards, Rob Philpott.
-
Dude, I think you need to rephrase that. I really can't understand what you want to say.
Regards, Rob Philpott.
if we need to draw a rectangle in a picture box we can do so easily.. on mouse down event i save the mouse cordinates. And on mouse up event i can draw a rectangle using the pointer position... All works fine. . But actually if you do such in paint, you can see a rectangle being drawn as we move our mouse ... How to doso ??
-
if we need to draw a rectangle in a picture box we can do so easily.. on mouse down event i save the mouse cordinates. And on mouse up event i can draw a rectangle using the pointer position... All works fine. . But actually if you do such in paint, you can see a rectangle being drawn as we move our mouse ... How to doso ??
-
if we need to draw a rectangle in a picture box we can do so easily.. on mouse down event i save the mouse cordinates. And on mouse up event i can draw a rectangle using the pointer position... All works fine. . But actually if you do such in paint, you can see a rectangle being drawn as we move our mouse ... How to doso ??
Ah ok, On the mouse down event, set a boolean to true. In the mouse up event, set it to false. In the Mouse move event, check the boolean and if its true then draw the rectangle. That should do what you want.
Regards, Rob Philpott.
-
if we need to draw a rectangle in a picture box we can do so easily.. on mouse down event i save the mouse cordinates. And on mouse up event i can draw a rectangle using the pointer position... All works fine. . But actually if you do such in paint, you can see a rectangle being drawn as we move our mouse ... How to doso ??
The answers already given will work. For some added 'cool' features Google for 'rubberbanding c#', and search MSDN for
DrawReversibleFrame
the page that you get has a nice example. Good Luck! :)Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
-
You need to draw the rectangles in MouseMove event as well along with Paint. (If I understood you correctly.)
जय हिंद
You got it correct. .. I have already done that, but what happens is once a rectangle is drawn with mouse move event , I am unable to remove it.. Thats the main problem ..
-
The answers already given will work. For some added 'cool' features Google for 'rubberbanding c#', and search MSDN for
DrawReversibleFrame
the page that you get has a nice example. Good Luck! :)Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”
This was it that i want. . . Rubberbanding. . I was unaware of that word.. Thanx anyway dude .