Jump to content

Print and preview


Recommended Posts

@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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...