Method function IGDIPlus.IGPGraphics.DrawCachedBitmap(IGPCachedBitmap;Integer;Integer) : TGPGraphics
This is a Beta Read Only version of this page. Please review and send recommendations to mitov@mitov.com. We will enable the editing as soon as we are happy with the overall Wiki site.
Class: IGPGraphics
Contents |
Syntax
Delphi:
function DrawCachedBitmap( cb : IGPCachedBitmap, x : Integer, y : Integer ) : TGPGraphics;
C++ Builder:
TGPGraphics __fastcall DrawCachedBitmap( IGPCachedBitmap cb, int x, int y );
Visual C++ (MFC):
DrawCachedBitmap( cb, x, y );
Summary
Draws the image stored in a TGPCachedBitmap object.
Description
Call this method to draw the image stored in a
TGPCachedBitmap object. Example: The following example calls DrawCachedBitmap to draw the image stored in a CachedBitmap object.
var AGraphics : IGPGraphics; ABitmap : IGPBitmap; ACachedBitmap : IGPCachedBitmap; begin AGraphics := TGPGraphics.Create( ACanvas ); // Create Bitmap object.
Bitmap := TGPBitmap.Create( 'Climber.jpg' );
// Use the Bitmap object to create a CachedBitmap object.
ACachedBitmap := TGPCachedBitmap( ABitmap, AGraphics );
// Draw the cached bitmap.
AGraphics.DrawCachedBitmap( ACachedBitmap, 20, 10 );
end;
Remarks A CachedBitmap object stores an image in a format that is optimized for a particular display screen. You cannot draw a cached bitmap to a printer or to a metafile.
Cached bitmaps will not work with any transformations other than translation.
When you construct a CachedBitmap object, you must pass the address of a Graphics object to the constructor. If the screen associated with that Graphics object has its bit depth changed after the cached bitmap is constructed, then the DrawCachedBitmap method will fail, and you should reconstruct the cached bitmap. Alternatively, you can hook the display change notification message and reconstruct the cached bitmap at that time.