April 27, 2024, 04:25:25 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


ddoc and bitmap resources

Started by mrainey, July 13, 2007, 07:35:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mrainey

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.
Software For Metalworking
http://closetolerancesoftware.com

splakidas

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

splakidas

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
.........................



uint xxx
xxx=dpAddGraphic(hFile, "c:/12.jpg")
dpDrawGraphic(hfile,xxx,1,1,5,5)   : rem <---------------display your pic
...........................
delete pic
...........................

dpEndDoc (hFile, endCode  )




mrainey

The resource extraction sub works great!  The rest should be something I can handle.

Thanks, splakidas and Paul.
Software For Metalworking
http://closetolerancesoftware.com