diff options
author | Jean-Marc Levecque <jean-marc.levecque@jmlesite.fr> | 2012-01-01 18:27:52 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2012-02-13 15:47:34 +0200 |
commit | 9bc64103edc0cb484fe346497e8a0bf8975c0037 (patch) | |
tree | 2f8a2fc9f27f1c0ec4565c87a19b906aa1a69854 /extras | |
parent | 58036ff804a98095cc063eac0a9fc7c434fa6c32 (diff) | |
download | fpGUI-9bc64103edc0cb484fe346497e8a0bf8975c0037.tar.xz |
Added printing of fpgImage from fpgImages list
Signed-off-by: Jean-Marc Levecque <jean-marc.levecque@jmlesite.fr>
Diffstat (limited to 'extras')
-rw-r--r-- | extras/contributed/report_tool/demo/u_demo.pas | 2 | ||||
-rw-r--r-- | extras/contributed/report_tool/reportengine/u_report.pas | 57 |
2 files changed, 53 insertions, 6 deletions
diff --git a/extras/contributed/report_tool/demo/u_demo.pas b/extras/contributed/report_tool/demo/u_demo.pas index 377e92cd..612e8dec 100644 --- a/extras/contributed/report_tool/demo/u_demo.pas +++ b/extras/contributed/report_tool/demo/u_demo.pas @@ -1536,7 +1536,7 @@ with FReport do ImagePage(30,40,'poppy.jpg',ColDefaut,3); ImagePage(40,70,'poppy.jpg',ColDefaut,2); ImagePage(50,130,'poppy.jpg'); - ImagePage(0,20,'radiobuttons.bmp',Col3); + ImagePage(0,20,'sys.radiobuttons',Col3); Page; ImagePage(0,0,'poppy-nb.jpg',Col2); ImagePage(20,100,'poppy.jpg',ColDefaut,2); diff --git a/extras/contributed/report_tool/reportengine/u_report.pas b/extras/contributed/report_tool/reportengine/u_report.pas index 9405ea99..ce16a378 100644 --- a/extras/contributed/report_tool/reportengine/u_report.pas +++ b/extras/contributed/report_tool/reportengine/u_report.pas @@ -2947,12 +2947,28 @@ then if (Copy(ImgFileName,Succ(Pos('.',ImgFileName)),3)= 'jpg') or (Copy(ImgFileName,Succ(Pos('.',ImgFileName)),4)= 'jpeg') then Image:= LoadImage_JPG(ImgFileName,Scale); - RefImage:= Images.Add(Image); + RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName); + Images.Add(Image); end; PaintImage(Horiz,Verti,ColNum,RefImage,zHeader); end else - ShowMessage('Image '+ImgFileName+' is missing'); + if fpgImages.GetImage(ImgFileName)<> nil + then + begin + RefImage:= ImageNames.IndexOf(IntToStr(Scale)+ImgFileName); + if RefImage= -1 + then + begin + Image:= fpgImages.GetImage(ImgFileName); + Scale:= 1; + RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName); + Images.Add(Image); + end; + PaintImage(Horiz,Verti,ColNum,RefImage,zPage); + end + else + ShowMessage('Image '+ImgFileName+' is missing'); end; procedure T_Report.ImagePage(Horiz,Verti: Single; ImgFileName: string; ColNum,Scale: Integer); @@ -2984,7 +3000,22 @@ then PaintImage(Horiz,Verti,ColNum,RefImage,zPage); end else - ShowMessage('Image '+ImgFileName+' is missing'); + if fpgImages.GetImage(ImgFileName)<> nil + then + begin + RefImage:= ImageNames.IndexOf(IntToStr(Scale)+ImgFileName); + if RefImage= -1 + then + begin + Image:= fpgImages.GetImage(ImgFileName); + Scale:= 1; + RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName); + Images.Add(Image); + end; + PaintImage(Horiz,Verti,ColNum,RefImage,zPage); + end + else + ShowMessage('Image '+ImgFileName+' is missing'); end; procedure T_Report.ImageFooter(Horiz,Verti: Single; ImgFileName: string; ColNum,Scale: Integer); @@ -3010,12 +3041,28 @@ then if (Copy(ImgFileName,Succ(Pos('.',ImgFileName)),3)= 'jpg') or (Copy(ImgFileName,Succ(Pos('.',ImgFileName)),4)= 'jpeg') then Image:= LoadImage_JPG(ImgFileName,Scale); - RefImage:= Images.Add(Image); + RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName); + Images.Add(Image); end; PaintImage(Horiz,Verti,ColNum,RefImage,zFooter); end else - ShowMessage('Image '+ImgFileName+' is missing'); + if fpgImages.GetImage(ImgFileName)<> nil + then + begin + RefImage:= ImageNames.IndexOf(IntToStr(Scale)+ImgFileName); + if RefImage= -1 + then + begin + Image:= fpgImages.GetImage(ImgFileName); + Scale:= 1; + RefImage:= ImageNames.Add(IntToStr(Scale)+ImgFileName); + Images.Add(Image); + end; + PaintImage(Horiz,Verti,ColNum,RefImage,zPage); + end + else + ShowMessage('Image '+ImgFileName+' is missing'); end; end. |