ShowImage

Show an image using irfanview or Windows 7 image viewer.
Looking to add more viewers, like Windows 8 (or 10) image viewer, and/or internal image viewer.
Similar attempts are ImaheOpen_IrfanView and FrmLarge


Tested

My Own Work
Sub ShowImage(ImageFullFile, Optional UseViewer = 1, Optional IVFol = "Resources")
    ' Open image in one of the viewers
    '    UseViewer = 1    ==>    Show using i_view32.exe /display
    '    UseViewer = 2    ==>    Show using Windows 7 photo viewer (Old viewer)
    '    UseViewer = 3    ==>    Show using Windows 8,10 image viewer (coming soon)
    '    UseViewer = 4    ==>    More coming soon
    '
   
    ' Default is UseViewer = 1 ==> Internal viewer
    Cmd1 = ""
    Cmd2 = ""
    If UseViewer = 1 Then
        ' i_view32.exe c:\test.jpg /display=(100,100,300,300,50,0,0)
        '    => Load image and set window position and size, zoom to 50%, scroll positions to 0
        ' i_view32.exe c:\test.jpg /display=(,,300,,50,30,30)
        '    => Load image and set window width, zoom to 50%, scroll positions to 30 (height and position = default/old)   
        Cmd1 = FixPath(FixPath() & IVFol) & "i_view32.exe"
        Cmd2 = " " & ImageFullFileSaveTo & "" /display=(100,100,300,,0,0,0) "
    ElseIf UseViewer = 2 Then
        ' %SystemRoot%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1
        Cmd1 = "rundll32.exe ""%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll"", "
        Cmd2 = "ImageView_Fullscreen """ & ImageFullFile & """"
    ElseIf UseViewer = 3 Then
        ' Not ready yet
    ElseIf UseViewer = 4 Then
        ' Not ready yet
    End If
    Shell Cmd1 & Cmd2
End Sub

ImageFullFile, Optional UseViewer = 1, Optional IVFol = "Resources"

Views 653 Downloads 238

VBA-Excel Multimedia
ANmarAmdeen
791
Attachments
Revisions

v1.0