![]() |
| ||
| Drawing line in pictureBox Hi, I have picture box with some image int it. I want to draw a line on the image. But when code executes, line is there but image is gone. Here is the code: bitmap bmp=new bitmap(pb.width,pb.height); graphics g=new graphics.fromImage(bmp); pen p=new pen(color.black,5); g.drawLine(p,0,0,10,10); Line is there, but underlaying image is gone. What should I do? Pete |
| ||
| Re: Drawing line in pictureBox Because you need to paint it there each time the picture is painted most likely |
| ||
| Re: Drawing line in pictureBox I'm working on application for WinMobile and there isn't OnPaint method there... |
| ||
| Re: Drawing line in pictureBox http://msdn.microsoft.com/en-us/libr...l.onpaint.aspx says there should be. failing that, do a search for captureing from a paintbox/form and saving it as a bmp, so you update the bmp in memory. |
| ||
| Re: Drawing line in pictureBox Thanks, I have sorted it out. Another question, do You have any idea how could I drag the image inside pictureBox instead of using scrollbars. |
| ||
| Re: Drawing line in pictureBox this was covered in another thread - you need to store the picture in memory, and then copy and show only in the picture box what the user is expecting to see |
| ||
| Re: Drawing line in pictureBox Do You have some example code, plz |
| ||
| Hello, Please tell me the some references about c#. |
| ||
| Re: Drawing line in pictureBox Won't the drag and drop method for control work in WM? |
| All times are GMT -4. The time now is 9:21 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC