I am creating a basic autocad viewer that has to deal with very large images.
I am using System.Drawing.Graphics to render images through:
Bitmap imageData;
public void Init(string filepath)
{
imageData = new Bitmap(filepath);
}
public void Render(System.Drawing.Graphics ctx)
{
ctx.DrawImage(imageData, x, y, w, h);
}
One particular file I'm dealing with has about ten files of size 8000x8000 pixels .tif. It goes without saying that the above drop is pretty good on it, with the exception of OutOfMemory.
Files are compressed up to several megabytes each. Can anyone suggest a better strategy for rendering them?
source
share