PSD view?
PSD view?
Do you know any way to make possible the display of .psd (Photoshop) images with a gui in Autohotkey?
Re: PSD view?
ImageMagick
Code: Select all
; AutoHotkey script to display a Photoshop image
; https://www.autohotkey.com/boards/viewtopic.php?f=76&t=80676
; Get convert.exe from https://imagemagick.org/script/download.php
source = [pathToPhotoshopFile]
If !FileExist(source) {
MsgBox, File '%source%' was not found. Aborting.
ExitApp
}
SplitPath, source,,, ext, fnBare
If ext not in ani,bmp,cpl,cur,dll,exe,gif,ico,jpg,png,scr,tif
{
SplashTextOn, 300, 100, Converting image...., Please wait....
target = %TEMP%\%fnBare%.png
FileRecycle, %target%
RunWait, [pathToConvert]\convert.exe %source% %target%,, Min
SplashTextOff
} Else target := source
If FileExist(target) {
Gui, Add, Picture,, %target%
Gui, Show,, %source% (ESC = Exit)
} Else MsgBox, File '%target%' was not found.
Return
GuiClose:
GuiEscape:
If (target != source)
FileRecycle, %target%
ExitApp
Re: PSD view?
DevIL
Code: Select all
SetWorkingDir %A_ScriptDir%
hBitmap := DevIL_FileToHBitmap("test.psd")
Gui, Add, Pic, , HBITMAP:%hBitmap%
Gui, Show
Return
; Requires DevIL.dll, ILU.dll, ILUT.dll
; from http://openil.sourceforge.net/
DevIL_FileToHBitmap(Filename)
{
hModule := DllCall("LoadLibrary", "str", "DevIL.dll", "ptr")
DllCall("DevIL\ilInit")
hDC := DllCall("GetDC", "ptr", 0, "ptr")
hBitmap := DllCall("ILUT\ilutWinLoadImage", "str", Filename, "ptr", hDC, "ptr")
DllCall("ReleaseDC", "ptr", 0, "ptr", hDC)
DllCall("DevIL\ilShutDown")
DllCall("FreeLibrary", "ptr", hModule)
return hBitmap
}
GuiClose() {
ExitApp
}