oPrn:SayBitmap with resource ?

oPrn:SayBitmap with resource ?

Postby TimStone » Thu Oct 24, 2013 9:59 pm

I am using the Printer class. I want to put a symbol at the beginning of a line ( checkmark ). The symbol ( and its counterpart ) are compiled in my resources.

I use the following to load the resources in a bitmap ( it works great for other purposes ):

aIBmp := { LoadBitMap( GetResources( ) , "INOK" ), LoadBitMap( GetResources( ), "INNO" ) }

Now I want to print out that checkmark so I use:

oPrn:SayBitmap( nRow, 5 * nCsp, aIBmp[1] )

In theory this should work. ( I have no problem printing external resources ). It doesn't. Do I need to get the value some other way from my resource so I can use it here ?

Thanks.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: oPrn:SayBitmap with resource ?

Postby Rick Lipkin » Thu Oct 24, 2013 10:24 pm

Tim

Consider this code .. you will have to use FreeImage.dll
Code: Select all  Expand view

DEFINE IMAGE oImg RESOURCE "DOG"
      oPrint:SayImage( Line, (oPrint:nHorzRes()*.80), oImg,800,600 )
 


Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: oPrn:SayBitmap with resource ?

Postby Enrico Maria Giordano » Fri Oct 25, 2013 12:15 pm

Tim,

TimStone wrote:I am using the Printer class. I want to put a symbol at the beginning of a line ( checkmark ). The symbol ( and its counterpart ) are compiled in my resources.

I use the following to load the resources in a bitmap ( it works great for other purposes ):

aIBmp := { LoadBitMap( GetResources( ) , "INOK" ), LoadBitMap( GetResources( ), "INNO" ) }

Now I want to print out that checkmark so I use:

oPrn:SayBitmap( nRow, 5 * nCsp, aIBmp[1] )

In theory this should work. ( I have no problem printing external resources ). It doesn't. Do I need to get the value some other way from my resource so I can use it here ?

Thanks.


It's most likely that the bitmap is too small for the printer. Try adding width and height parameters to SayBitmap() method.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8713
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 88 guests