Has anybody been able to use a bitmap resource with the ddoc printing library? It's easy to include a bitmap on the report by referring to a .bmp file, but I'd like to keep everything inside the executable if possible.
Hi i use ddoc.
ddoc needs a handle to display a pic
DECLARE "ddoc32.dll", dpAddGraphic(iHandle:INT, zFileName:STRING),INT
i will see if its possible to display a resource pic
mrainey the problem is you have to use a path for your image
Declare Function dpAddGraphic Lib "ddoc32.dll" ( ByVal iHandle%, ByVal zFileName$ ) as Long
Another solution is to extract the picture from your resource, use it with ddoc and delete it after you use the command.
hFile = dpStartDoc(0, "header txt", "", DDOC_CM, DDOC_PAPER_A4, DDOC_PORTRAIT, DDOC_BIN_LOWER, DDOC_ZOOMFIT|DDOC_ALLOWSAVE|DDOC_ALLOWSMTP|DDOC_ALLOWFAX)
.........................
extract resource code
http://www.codingmonkeys.com/index.php?action=dlattach;topic=558.0;attach=168 (http://www.codingmonkeys.com/index.php?action=dlattach;topic=558.0;attach=168)
.........................
uint xxx
xxx=dpAddGraphic(hFile, "c:/12.jpg")
dpDrawGraphic(hfile,xxx,1,1,5,5) : rem <---------------display your pic
...........................
delete pic
...........................
dpEndDoc (hFile, endCode )
The resource extraction sub works great! The rest should be something I can handle.
Thanks, splakidas and Paul.