I am drawing to an offscreen bitmap various shapes and so on. I have
created a bitmap for this purpose. But the bitmap has a black background
so i used the make transparent method to clear the background. But i use
scroll bars if the image is too big for the client area. When i scroll
down the screen cannot redraw itself correctly. If i dont use the
transparent method and the background is black it does not do this. I
saw in the bitmap.drawback ground method that it does not recognize
transparent bitmaps.......h ow do i solve this problem to redraw the
screen correctly when scrolling through a transparent bitmap....here is
the method for scrolling event.
private void HandleScroll(Ob ject sender, ScrollEventArgs se)
{
/* Create a graphics object and draw a portion
_canvasGraphics = pictureBox1.Cre ateGraphics();
_canvasGraphics .DrawImage(_can vasImage,
new Rectangle(0, 0, pictureBox1.Rig ht - vScrollBar1.Wid th,
pictureBox1.Bot tom - hScrollBar1.Hei ght),
new Rectangle(hScro llBar1.Value, vScrollBar1.Val ue,
pictureBox1.Rig ht - vScrollBar1.Wid th,
pictureBox1.Bot tom - hScrollBar1.Hei ght),
GraphicsUnit.Pi xel);
pictureBox1.Upd ate();
}
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!