J
James Dean
I am drawing in a picturebox and am having some problems. I display
outputted images in the picturebox. If the image is too big for the
client area then i have scrollbars. The problem is that once i draw a
bitmap to the picturebox I have trouble displaying graphics inside the
picturebox. I
pictureBox1.image = Image.FromFile("OutBinary.bmp");
This image is displayed in the picturebox with scrollbars. Then i try to
do the following. Once i touch the scroll bars the original bitmap image
gets displayed again. How do i change the image to display only the new
polygon data.
_canvasImage.MakeTransparent();
_canvasGraphics = Graphics.FromImage(_canvasImage);
_canvasGraphics.Clear(Color.White);
_canvasGraphics = pictureBox1.CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Black);
_canvasGraphics.Clear(Color.White)
.......do various calculations to get polygon points
_canvasGraphics.FillPolygon(brush,polgon_points);
this.displayscrollbars()
this.setscrollbarvalues();
outputted images in the picturebox. If the image is too big for the
client area then i have scrollbars. The problem is that once i draw a
bitmap to the picturebox I have trouble displaying graphics inside the
picturebox. I
pictureBox1.image = Image.FromFile("OutBinary.bmp");
This image is displayed in the picturebox with scrollbars. Then i try to
do the following. Once i touch the scroll bars the original bitmap image
gets displayed again. How do i change the image to display only the new
polygon data.
_canvasImage.MakeTransparent();
_canvasGraphics = Graphics.FromImage(_canvasImage);
_canvasGraphics.Clear(Color.White);
_canvasGraphics = pictureBox1.CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Black);
_canvasGraphics.Clear(Color.White)
.......do various calculations to get polygon points
_canvasGraphics.FillPolygon(brush,polgon_points);
this.displayscrollbars()
this.setscrollbarvalues();