Re: Saving a large TJpeg - Insufficient Resources?
- From: Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx>
- Date: Wed, 24 Oct 2007 20:41:51 -0400
Nicholas Sherlock wrote:
Roy wrote:changing it to a DIB instead of the default DDB will solve that issue.
I'm loading the file into a TJpegImage, creating a Tbitmap and using stretchdraw to copy the data to the bitmap - then using the bitmap.canvas to write my text, then finally using jpeg.assign to get back into jpeg format before using jpg.savetofile
but... with the larger images (3000x2000 pixels) I'm getting an exception telling me there are insufficient resources. If it can load the jpeg to start with, how can this be??
IIRC, on Windows you're only guaranteed to be able to create a Windows bitmap that's the same size as the screen, no larger. The bitmap you have there is very large! I'd investigate TBitmap32, from Graphics32, which either doesn't use Windows to create the bitmap, or can be patched so that it doesn't (I can't remember which).
Cheers,
Nicholas Sherlock
even with printer output..
as soon as you set the pixel format, it's converted.
mybitmap.pixelformat := pf32bit; for example.
how ever, I've found that many print drivers do not handle
32 bit DIB's for some reason. so for printing, I stick to 24 bit.
--
"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
.
- References:
- Saving a large TJpeg - Insufficient Resources?
- From: Roy
- Re: Saving a large TJpeg - Insufficient Resources?
- From: Nicholas Sherlock
- Saving a large TJpeg - Insufficient Resources?
- Prev by Date: Re: Saving a large TJpeg - Insufficient Resources?
- Next by Date: Re: How to time the execution of a method?
- Previous by thread: Re: Saving a large TJpeg - Insufficient Resources?
- Index(es):
Relevant Pages
|