myGraphic := TBitmap.Create;
myGraphic.LoadFromFile(ExtractFilePath(Application.ExeName) + '
!NewCard.bmp');
X := GetDeviceCaps(PrntHandle,PHYSICALOFFSETX);
Y := GetDeviceCaps(PrntHandle,PHYSICALOFFSETY);
GetDIBSizes(myGraphic.Handle, HeaderSize, ImageSize);
Bitmapheader := VirtualAlloc(
nil, HeaderSize, MEM_COMMIT, PAGE_READWRITE);
BitmapImage := VirtualAlloc(
nil, ImageSize, MEM_COMMIT, PAGE_READWRITE);
try
StretchDIBits(PrntHandle, 0 - X, 0 - Y, 1027, 648, 0, 0,
myGraphic.Width, myGraphic.Height, BitmapImage,
TBitmapInfo(BitmapHeader^), DIB_RGB_COLORS, SRCCOPY);
// Diese Funktion sagt einer DLL lediglich dass sie den Druckauftrag beenden kann -> EndDoc
Result := _DCContinue(ICE_SMART_CARD_GOOD);
finally
VirtualFree(Bitmapheader, 0, MEM_FREE);
VirtualFree(bitmapimage, 0, MEM_FREE);
end;