Sign in to follow this  
Followers 0
LOULOU

Print and preview

2 posts in this topic

Has anyone written a progrm to able a preview printing file ?

Thanks in advance .

Share this post


Link to post
Share on other sites



@LOULOU

Maybe this is a good start.

Opt("GUIOnEventMode", True)

HotKeySet("`", "_LoadPicture")
HotKeySet("=", "_Zoom")
HotKeySet("-", "_Zoom")

$oPreview = ObjCreate("Preview.Preview.1")

GUICreate("Preview Test")
GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit")
$GUI_OBJ = GUICtrlCreateObj($oPreview, 10, 10, 380, 380)
GUISetState()

_LoadPicture()

While 1
    Sleep(100)
WEnd

Func _LoadPicture()
    $sFile = FileOpenDialog("Open Image", @MyDocumentsDir & "\My Pictures", "Image files (*.bmp;*.jpg;*.jpeg)", 1)
    If @error Then Return
    $oPreview.ShowFile ($sFile, 1)
EndFunc   ;==>_LoadPicture

Func _Zoom()
    Switch @HotKeyPressed
        Case "-"
            $oPreview.Zoom (-1)
        Case "="
            $oPreview.Zoom (1)
    EndSwitch
EndFunc   ;==>_Zoom

Func _Exit()
    Exit
EndFunc   ;==>_Exit

regards

ptrex

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0