0

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

4
Contributors
8
Replies
9
Views
8 Years
Discussion Span
Last Post by hieuuk
0

I'm working on application for WinMobile and there isn't OnPaint method there...

0

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.

0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.