I have an application that prints the text and images of pages on a printer. On the footer, we produce an image, which is cached from it once loaded, and stored in a TBitmap. In print routines, it creates a new TBitmap, then calls a function that specifies the cached bitmap. It again calls the canvas. Draw Stretch on that bitmap
Function Gatefuter Graphic (Verti Exhibit: TBITMAP): Boolean; Get started // Load cache if assigned (g_xFooterBitmap) then start xBitmap.Assign (g_xFooterBitmap); Result: = True; End; Get the end // bitmap, then: xCanvas.StretchDraw (xDrawRect, xBitmap); The problem is that bitmap has failed to work after certain pages. I can only imagine that this is a driver problem, but it happens on most printers at different times. I can fix this by reloading the bitmap every time, but I want to keep the cache.
After viewing VCL, xBitmap.Assign actually adds references to archived items. What I want to do is take a complete copy, the most effective method that comes on the question:
How can I make totally TBITM content free from any other reference?
I would like to keep the cached T-bitmap contents completely independent, and return a full (deep) copy so that the printing can not affect the cached version, and thus it is expected that Fix the problem.
If relevant, then Delphi 2007.
I can not test it here because I can not reproduce the problem, but May be able to assign after calling FreeImage .
Comments
Post a Comment