zou iemand mij kunnen vertellen hoe ik een jpg plaatje kan afdrukken? direct uit een bestand of via TImage, dat maakt niet uit.
Hier een gratis stukje code waarover ik toevallig struikelde 
C:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| unsigned int BitmapInfoSize, BitmapImageSize; long DIBWidth, DIBHeight; PChar BitmapImage; Windows::PBitmapInfo BitmapInfo; Graphics::TBitmap *Bitmap; Printer()->BeginDoc(); Bitmap = new Graphics::TBitmap(); Bitmap->Assign(Image->Picture); GetDIBSizes(Bitmap->Handle, BitmapInfoSize, BitmapImageSize); BitmapInfo = (PBitmapInfo) new char[BitmapInfoSize]; BitmapImage = (PChar) new char [BitmapImageSize]; GetDIB(Bitmap->Handle, 0, BitmapInfo, BitmapImage); DIBWidth = BitmapInfo->bmiHeader.biWidth; DIBHeight = BitmapInfo->bmiHeader.biHeight; StretchDIBits(Printer()->Canvas->Handle, 0, 0, DIBWidth, DIBHeight, 0, 0, DIBWidth, DIBHeight, BitmapImage, BitmapInfo, DIB_RGB_COLORS, SRCCOPY); delete [] BitmapImage; delete [] BitmapInfo; delete Bitmap; Printer()->EndDoc(); |
We adore chaos because we like to restore order - M.C. Escher
En waarom die omweg en niet gewoon een TJPEGImage drawen op Printer()->Canvas?
Dat schijnt niet helemaal ok te gaan ofzo...
We adore chaos because we like to restore order - M.C. Escher
Bedankt, ik heb het opgelost met StretchDraw op de Printer canvas