Re: DrawImage and Out Of Memory
- From: "gOODiDEA" <goodidea2002@xxxxxxxxx>
- Date: Wed, 29 Jun 2005 10:13:22 +0800
Graphics g = Graphics.FromImage(firstBitmap);
Matrix m = new Matrix();
m.Scale(0.05, 0.05);
g.DrawImage(secondBitmap, 0, 0).
==>
g.Dispose();
after you don't use firstBitmap or secondBitmap,you should dispose them
firstBitmap.Dispose();
secondBitmap.Dispose();
"Peter Laurinc" <grbo@xxxxxxxxxx> wrote in message
news:echIgt9dFHA.3040@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I have problem with drawing large bitmaps.
>
> There is firstBitmap 32bppARGB for offscreen drawing sized cca 1000x700
> pixels.
> From file I load secondBitmap 1bppIndexed sized ccz 9000x14000. I want to
> draw second bitmap scaled to first bitmap.
>
> I get graphics from firstBitmap and set it appropiate transform matrix.
> then I use
>
> Graphics g = Graphics.FromImage(firstBitmap);
> Matrix m = new Matrix();
> m.Scale(0.05, 0.05);
> g.DrawImage(secondBitmap, 0, 0).
>
> I always get Out Of Memory on this line.
> Also in any operation with second bitmap.
> When I try to save second bitmap to BMP file, file is saved OK and is
> sized cca 16MB.
>
> Anybody helps?
>
> Thanks
>
> Peter
>
.
- Follow-Ups:
- Re: DrawImage and Out Of Memory
- From: Peter Laurinc
- Re: DrawImage and Out Of Memory
- References:
- DrawImage and Out Of Memory
- From: Peter Laurinc
- DrawImage and Out Of Memory
- Prev by Date: Printing Cheques
- Next by Date: Re: links to help using a window handle to print graphics to
- Previous by thread: DrawImage and Out Of Memory
- Next by thread: Re: DrawImage and Out Of Memory
- Index(es):
Relevant Pages
|