PDF and BMP preview

PDF and BMP preview

Postby Marco Turco » Wed May 21, 2008 10:32 am

Hi,
I would like display on the same dialog a preview of a BMP image or a PDF file.

There is no problems with the image files but could be possibile to use the same IMAGE control to display also a pdf ?

This is a self-contained semplified code that I use to manage a bmp preview.

Do I have to use the PDF activex to preview a pdf file into the image control ?

Any ideas ?

Thanks in advance.



function Main()

LOCAL oDlg, oImage

DEFINE DIALOG oDlg FROM 0, 0 TO 20, 60 ;
TITLE FWDESCRIPTION + " BMP,PDF support!"

@ 0, 0 IMAGE oImage SIZE 150, 150 OF oDlg SCROLL // ADJUST

oImage:Progress( .f. )

@ 1, 28 BUTTON "Select Image" SIZE 50,10 OF oDlg ACTION GetImage( oImage )

@ 6, 28 BUTTON "Exit" SIZE 50, 10 OF oDlg ACTION oDlg:End()

@ 10, 26 CHECKBOX oImage:lStretch PROMPT "Stretch" SIZE 50, 10 OF oDlg ;
ON CHANGE ( oImage:ScrollAdjust(), oImage:Refresh() )

ACTIVATE DIALOG oDlg CENTER

return nil

//----------------------------------------------------------------------------//

function GetImage( oImage )

local gcFile := cGetFile( "Bitmap (*.bmp)| *.bmp|" + ;
"PDF (*.pdf)| *.pdf|" + ;
"All Files (*.*)| *.*" ;
,"Please select a image file", 4 )

if ! Empty( gcFile ) .and. File( gcFile )
oImage:LoadBmp( gcFile )
endif

return nil
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 71 guests