FastReport LoadImageFromHbVar
-
- Posts: 1078
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- Has thanked: 1 time
FastReport LoadImageFromHbVar
Hello,
I am trying to print a image in FR, I want to use LoadImageFromHbVar because I need to generate the image only for the report.
I found a topic about it but for me don't work, some body work with this function?
regards
Marcelo
I am trying to print a image in FR, I want to use LoadImageFromHbVar because I need to generate the image only for the report.
I found a topic about it but for me don't work, some body work with this function?
regards
Marcelo
-
- Posts: 467
- Joined: Sun Oct 30, 2005 6:37 am
- Location: Guangzhou(Canton),China
- Contact:
Re: FastReport LoadImageFromHbVar
1. Static
Add picture object-- close the "picture" windows--left tribution table--file link--- d:\myfold\aaaa.jpg --OK
2. Dynamic
2.1). Add picture object-- close the "picture" windows--left tribution table--event Picture1OnBeforePrint
2.2). code:
procedure Picture1OnBeforePrint(Sender: TfrxComponent);
begin
callhbfunc('fr3img',['.\sub\'+vartostr(<masterdata."imgid">)+'.jpg']) ; // this selft defined prg function to load current row jpg into private 'myvar'
LoadImageFromHbVar(Picture1,'fr3img');
end;
begin
end.
// " picture1" is the name of the picture object, can be edited in the left tribution table .
2.3) prg :
private fr3img
FrPrn := frReportManager():new()
2.4 prg:
FUNCTION fr3img(file1)
fr3img:=nil
fr3img:=memoread(file1)
sysrefresh()
return
Add picture object-- close the "picture" windows--left tribution table--file link--- d:\myfold\aaaa.jpg --OK
2. Dynamic
2.1). Add picture object-- close the "picture" windows--left tribution table--event Picture1OnBeforePrint
2.2). code:
procedure Picture1OnBeforePrint(Sender: TfrxComponent);
begin
callhbfunc('fr3img',['.\sub\'+vartostr(<masterdata."imgid">)+'.jpg']) ; // this selft defined prg function to load current row jpg into private 'myvar'
LoadImageFromHbVar(Picture1,'fr3img');
end;
begin
end.
// " picture1" is the name of the picture object, can be edited in the left tribution table .
2.3) prg :
private fr3img
FrPrn := frReportManager():new()
2.4 prg:
FUNCTION fr3img(file1)
fr3img:=nil
fr3img:=memoread(file1)
sysrefresh()
return
http://www.xtech2.top
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
Mobile:(86)13802729058
Email:100200651@qq.com
QQ:100200651
Weixin: qq100200651
-
- Posts: 1078
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- Has thanked: 1 time
Re: FastReport LoadImageFromHbVar
ShumingWang,
thanks very much for your response, I found my problem, we MUST to define the variable like a PRIVATE (don't work with other definition), then we need to relax the xHarbour compile switch
because with private variables I get error message "Ambiguous reference" I don't know why?
regards
Marcelo
thanks very much for your response, I found my problem, we MUST to define the variable like a PRIVATE (don't work with other definition), then we need to relax the xHarbour compile switch
because with private variables I get error message "Ambiguous reference" I don't know why?
regards
Marcelo
- Enrico Maria Giordano
- Posts: 8761
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 5 times
- Contact:
Re: FastReport LoadImageFromHbVar
Marcelo,
Use
EMG
Marcelo Via Giglio wrote:ShumingWang,
thanks very much for your response, I found my problem, we MUST to define the variable like a PRIVATE (don't work with other definition), then we need to relax the xHarbour compile switch
because with private variables I get error message "Ambiguous reference" I don't know why?
regards
Marcelo
Use
Code: Select all | Expand
M -> myvar
EMG
-
- Posts: 1078
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- Has thanked: 1 time
Re: FastReport LoadImageFromHbVar
Thanks Enrico,
I didn't use PRIVATE variables since clipper.
Other question how can I get the same result than MEMOREAD("bmpfile.bmp") using a bmp object. I have a bmp in memory (generated), how can I convert this BMP to use like MEMOREAD whiout pass it to a disk file.
Regards
Marcelo
I didn't use PRIVATE variables since clipper.
Other question how can I get the same result than MEMOREAD("bmpfile.bmp") using a bmp object. I have a bmp in memory (generated), how can I convert this BMP to use like MEMOREAD whiout pass it to a disk file.
Regards
Marcelo
-
- Posts: 1078
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- Has thanked: 1 time
Re: FastReport LoadImageFromHbVar
Marcelo,
Can you share the details regarding how you were able to load the bitmap from memory?
Regards,
Robb
Can you share the details regarding how you were able to load the bitmap from memory?
Regards,
Robb
-
- Posts: 1078
- Joined: Fri Oct 07, 2005 3:33 pm
- Location: Cochabamba - Bolivia
- Has thanked: 1 time
Re: FastReport LoadImageFromHbVar
Robb,
the question is not clear for me but I can public some code
regards
Marcelo
the question is not clear for me but I can public some code
Code: Select all | Expand
oBmp:= TBitmap():Define()
oBmp:hBitMap := BuildCode( CODEBAR_QR, "QR", HB_ZEBRA_FLAG_QR_LEVEL_MASK ) //create bitmap in memory
hDib := DibFromBitmap( oBmp:hBitMap ) // read dib from bitmap
DibToStr( hDib ) // convert dib to string
GloBalFree( hDib )
regards
Marcelo
Re: FastReport LoadImageFromHbVar
Thank you, that was quick.
I finally found what I need, or at least what I can use. There is a TBitmap() method named LoadFromString() that does the trick. Finally found it in the source code, it doesn't appear to be documented otherwise.
Thank you so much for the reply.
Robb
I finally found what I need, or at least what I can use. There is a TBitmap() method named LoadFromString() that does the trick. Finally found it in the source code, it doesn't appear to be documented otherwise.
Thank you so much for the reply.
Robb