D
delong
Hi
I am trying to display a large image on the form and make the form
scrollable.
My image is about 4200 x 7000 pixel.
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs
e)
{
Graphics g=e.Graphics;
g.DrawImage(Image,0,0,Image.Width,Image.Height);
}
The image display correctly and the scrolling works fine. However the
scrolling is not
smooth ( scrolling movement is jaggered ). Seems the image is not updated
fast enough.
I have tried with IE and photoshop to open the same image and both
application is able
to scroll the image quite smoothly. So far I have not seen any posted sample
that can scroll
large image smoothly.
I have even tried various method such as Clipping only the client region
using
Region r= new
Region(0,0,this.ClientRectangle.Width,this.ClientRectangle.Height);
g.Clip=r;
and using
Rectangle dr=new
Rectangle(0,0,this.ClientRectangle.Width,this.ClientRectangle.Height);
g.DrawImage(Image,dr,dr,GraphicsUnit.Pixel);
but it stills does not achieve what I want.
Anyone have any idea how scroll very large image smoothly ?
Thanks
Danial
I am trying to display a large image on the form and make the form
scrollable.
My image is about 4200 x 7000 pixel.
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs
e)
{
Graphics g=e.Graphics;
g.DrawImage(Image,0,0,Image.Width,Image.Height);
}
The image display correctly and the scrolling works fine. However the
scrolling is not
smooth ( scrolling movement is jaggered ). Seems the image is not updated
fast enough.
I have tried with IE and photoshop to open the same image and both
application is able
to scroll the image quite smoothly. So far I have not seen any posted sample
that can scroll
large image smoothly.
I have even tried various method such as Clipping only the client region
using
Region r= new
Region(0,0,this.ClientRectangle.Width,this.ClientRectangle.Height);
g.Clip=r;
and using
Rectangle dr=new
Rectangle(0,0,this.ClientRectangle.Width,this.ClientRectangle.Height);
g.DrawImage(Image,dr,dr,GraphicsUnit.Pixel);
but it stills does not achieve what I want.
Anyone have any idea how scroll very large image smoothly ?
Thanks
Danial