Hi,
I'm trying to overlay a image with a couple of other images. I use this code to do that:
Dim gbkn As Bitmap = New Bitmap(7001, 7001, Imaging.PixelFormat.Format32bppArgb)
Dim g As Graphics = Graphics.FromImage(CType(gbkn, Image))
g.DrawImage(Image.FromFile("C:\background.png"), New Point(0, 0))
g.DrawImage(Image.FromFile("C:\firstlayer.png"), New Point(0, 0))
g.DrawImage(Image.FromFile("C:\secondlayer.png"), New Point(0, 0))
This works with the first two pictures. After that an OutOfMemoryException is thrown. I realize the size of the images are large. But isn't it somehow possible to do the overlays and chache them somewhere?
Even if I save the result of the first overlay to disk, free memory, and add another layer I still get the exception.
How should I approach this problem?
JosP