Re: Saving a large TJpeg - Insufficient Resources?



Roy wrote:
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
.



Relevant Pages

  • Re: Transparent Blit with NT4
    ... > Mike D Sutton wrote: ... > Pretty sure I'm not - I have tested it on Windows ME, works fine, and ... >> Also, how are you creating the bitmap you're drawing from, and what ... > REM and direct drawing for the rest ...
    (microsoft.public.win32.programmer.gdi)
  • Re: Bitmaps anzeigen?
    ... The SetDIBitsToDevice function sets the pixels in the specified ... Windows 98/Me, Windows 2000/XP: ... // array of DIB bits ... CONST BITMAPINFO *lpbmi, // bitmap information ...
    (microsoft.public.de.vc)
  • Re: Saving and loading bmp using graphics object
    ... Windows needs to know that part of your window needs redrawing. ... that this bitmap is a copy of what you want to appear on screen. ... > private void DrawPoint ... > private void Scribbler_MouseMove(object sender,> System.Windows.Forms.MouseEventArgs e) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Why is Screen Sharing app hidden away?
    ... button, add this bitmap" just the same as Windows does locally, or X ... VNC is an after-the-fact "copy this bitmap over the ... should be able to hook in at that layer and send those instructions ... Is it a tarted up VNC or does it do the same as Windows ...
    (uk.comp.sys.mac)
  • Re: Fast drawing of graphs
    ... Actually, if you use MFC, it is equally trivial to draw on a background bitmap; ... used full-screen displays with splitter windows and never resized the windows, ... >I programmed a class that draws an x-y graph on a CStatic window. ... >achieved by not drawing directly on the, but drawing to a hidden bitmap ...
    (microsoft.public.vc.mfc)