nageswaragunupudi wrote:This is a small sample program.
#include "fivewin.ch"
function Main()
local oPrn
SetCustomPrintPreview( { |o| DlgPreview( o ) } )
PRINT oPrn PREVIEW
oPrn:SetPage( 11 )
PAGE
@ 1,1 PRINT TO oPrn IMAGE "..\bitmaps\olga1.jpg" ;
SIZE 9,29 CM ALIGN "T"
ENDPAGE
PAGE
@ 1,1 PRINT TO oPrn IMAGE "..\bitmaps\sea.bmp" ;
SIZE 9,29 CM ALIGN "T"
ENDPAGE
ENDPRINT
SetCustomPrintPreview( nil )
return nil
function DlgPreview( oPrn )
local oDlg, oBar, oImage, nPage := 1
local lBar := Len( oPrn:aMeta ) > 1
DEFINE DIALOG oDlg SIZE 300,400 PIXEL TRUEPIXEL RESIZABLE
if lBar
DEFINE BUTTONBAR oBar OF oDlg SIZE 32,40 2010 NOBORDER
endif
@ If( lBar, 60, 20 ),20 XIMAGE oImage SOURCE oPrn:aMeta[ 1 ] SIZE -20,-20 OF oDlg
if lBar
DEFINE BUTTON OF oBar RESOURCE FWBitmap( "top2" ) ;
WHEN nPage > 1 ;
ACTION oImage:SetSource( oPrn:aMeta[ nPage := 1 ] )
DEFINE BUTTON OF oBar RESOURCE FwBitmap( "previous2" ) ;
WHEN nPage > 1 ;
ACTION oImage:SetSource( oPrn:aMeta[ --nPage ] )
DEFINE BUTTON OF oBar RESOURCE FWBitmap( "next2" ) ;
WHEN nPage < Len( oPrn:aMeta ) ;
ACTION oImage:SetSource( oPrn:aMeta[ ++nPage ] )
DEFINE BUTTON OF oBar RESOURCE FWBitmap( "bottom2" ) ;
WHEN nPage < Len( oPrn:aMeta ) ;
ACTION ( oImage:SetSource( oPrn:aMeta[ nPage := Len( oPrn:aMeta ) ] ) )
endif
ACTIVATE DIALOG oDlg CENTERED
return nil
Please modify the size of the dialog as per your needs.

Nages I tested your script
When I go to Small Rpreview I have this
when I size to big the dialog I have this
the image is printed at center , then the image is printed on center or it printed on left ?
problem I not see the buttonbar because I have only a page ok but I wish insert two buttons one for exit and one for print
how I can make ?
If I use
@ nTop + nMargineSuperiore,nLeft + nMargineSinistro PRINT TO oPrn IMAGE cFile ;
SIZE nRight, nBottom CM ALIGN "T"
and I have this result
the image is not printed correctly in the position, I use this function where I convert the measurements from cm to Pixel
FUNCTION PrintImage(nTop, nLeft, nRight, nBottom, cFile, nMargineSuperiore, nMargineSinistro, oPrn)
oPrn:Cmtr2Pix(@nTop, @nLeft)
oPrn:Cmtr2Pix(@nBottom, @nRight)
oPrn:SayImage(nTop + nMargineSuperiore, nLeft + nMargineSinistro, cFile, nRight, nBottom)
return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com