Hi, I created an image viewer in C#. I want to know how I can add a zoom and pan feature to the picture box. I've searched the web for panning an image a lot but no use. I've searched zooming also. There are results for zooming like:
Image Zoom(Image img, Size size)
{
Bitmap btm = new Bitmap(img, img.Width + (img.Width * size.Width / 100), img.Height + (img.Height * size.Height / 100));
Graphics g = Graphics.FromImage(btm);
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
return btm;
}
But this code makes the zooming a lot slower, not sure why.
Please help