Device 2 Example

Top  Previous  Next

inc        C:\CXPL\EXPLCodes.xpl;        \intrinsic declarations

 

int Image,W,H;

 

begin

OpenI(2);                                \Allow user to select printer

OpenO(2);                                \Initialize Selected printer

Text(2,"Hello World");                \Output text

CRLF(2);

 

Image:=AllocateBitmap;                                \Allocate a bitmap

LoadBitmap(Image,"spring.bmp");                \Load an image from disk

GetBitmapSize(Image,@W,@H);                \Get the image size

PrintImage(Image,0,0,W*4,H*4);                \Print the image stretch by four times

 

Close(2);                                \Print image and accumulated text

DeAllocBitmap(Image);                \Deallocate Bitmap

end;