Jump to content

GuiCtrlCreatePic equivalent for PNG or TIFF images?


Go to solution Solved by Melba23,

Recommended Posts

I've searched for an answer to this question but haven't found one, so I hope it's OK to ask here.

Is there any UDF or anything else that will display a PNG or TIFF image in a control like GuiCtrlCreatePic? The built-in function only displays BMP, JPG, or GIF, but I'm trying to create a script that displays a PNG or TIFF.

Probably the answer is No, but I can always hope.

Link to comment
Share on other sites

  • Moderators
  • Solution

emendelson,

If you look in my _ExtMsgBox UDF (link is in my sig)  you will find the __EMB_ShowPNG function which allows you display PNG files. No idea about TIFF I am afraid.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I don't know if it works with TIF's but sure it works with PNG's. Edit: Just tested with the welcomefax.tif (the onliest tif i have) and it works:

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUICtrlPic.au3>
#include <Array.au3>

Global $hGui = GUICreate("Show Tif",@DesktopWidth, @DesktopHeight)
Global $aDim = WinGetClientSize($hGui)
Global $sAutoItPath
If @Compiled Then
    $sAutoItPath=RegRead64('HKLM\Software\AutoIt v3\AutoIt', 'InstallDir')&'\'
Else
    $sAutoItPath= StringReplace(@AutoItExe, "autoit3.exe", "")&'\'
    $sAutoItPath= StringReplace(@AutoItExe, "autoit3_x64.exe", "")
EndIf


Global $Background = _GUICtrlPic_Create("C:\Users\(len)Bert\Downloads\Documents\Fax\Inbox\WelcomeFax.tif", 0, 0, $aDim[0], $aDim[1], $SS_CENTERIMAGE, Default)
GUICtrlSetState(-1, $Gui_DISABLE)
GUISetState()


While 1
    Switch GUIGetMsg()
        Case $Gui_EVENT_CLOSE
            Exit
    EndSwitch
WEnd


Func RegRead64($sKeyname, $sValue)
    ;Aus AutoUpdateIt.au3
    Local $sRes = RegRead($sKeyname, $sValue)
    If @error And @AutoItX64 Then
        $sKeyname = StringReplace($sKeyname, "HKEY_LOCAL_MACHINE", "HKLM")
        $sKeyname = StringReplace($sKeyname, "HKLM\SOFTWARE\", "HKLM\SOFTWARE\Wow6432Node\")
        $sRes = RegRead($sKeyname, $sValue)
        If @error Then
            SetError(1)
            Return ""
        EndIf
    EndIf
    SetError(0)
    Return $sRes
EndFunc   ;==>RegRead64

 

GUICtrlPic.au3

Edited by AutoBert
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...