|
Hello
i have used a scroll bar to move an image. The problem is that when i use the scroll bar the program gets slow.
the paint handler which is used for painting in my program is this
Bitmap bitmap=new Bitmap("c\\temp\\image.bmp");
private void DrawArea_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; SolidBrush brush = new SolidBrush(Color.FromArgb(255, 255, 255)); g.FillRectangle(brush, this.ClientRectangle); g.DrawImageUnscaled( bitmap, this.ClientRectangle.X , -OffSetY, bitmap.Width, bitmap.Height); this.Refresh(); }
the vertical scroll bar handler which i have used so far is this
private void vScrollBar1_Scroll(object sender, ScrollEventArgs e) { offsety = e.NewValue; }
Thanks Regards MS Chaudhary
|