Jump to content
Sign in to follow this  
Lolita

Show fullscreenimage (on top)

Recommended Posts

Lolita

Hello i'm tring to have autoit display fullscreen image on top and resample it from higher size to lover (or vice versa) to screensize. I found somehthing cxImage, but it don't work for me and i didn't find anythink about how to do fullscreen.

Where should i start and what i sould search for?

Share this post


Link to post
Share on other sites
Generator

@DesktopWidth and @DesktopHeight

Share this post


Link to post
Share on other sites
monoceres

No need go into advanced stuff:

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
GUICreate("",@DesktopWidth,@DesktopHeight,0,0,$WS_POPUPWINDOW,$WS_EX_TOPMOST)
$picname = FileOpenDialog("Picture to display", @MyDocumentsDir, "Pictures (*.jpg;*.bmp)", 1)
If $picname="" Then Exit
GUICtrlCreatePic($picname,0,0,@DESKTOPWidth,@DesktopHeight)
GUISetSTate()
Do
    $msg = GUIGetMsg()
Until $msg=$GUI_EVENT_CLOSE
Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
Lolita

Wow, that is superb, i really didn't expected full working script as reply! Thanks!

Edited by Lolita

Share this post


Link to post
Share on other sites
Squirrely1

Here are a couple of functions that you might find to be helpful with this project:

Global Enum $GIF_SUCCESS, $GIF_INVALID_sARRAY, $GIF_UNKNOWN_ERROR, $GIF_COM_ERROR, _
        $GIF_OBJCREATE_ERROR, $GIF_FILE_NOTFOUND, $GIF_INVALID_HWND
Func GetImagePercentSize($i_width, $i_height, $intPercent)
    Local $retArr[2]
    $retArr[0] = Round($i_width * $intPercent / 100)
    $retArr[1] = Round($i_height * $intPercent / 100)
    Return $retArr
EndFunc
; I think simucal wrote this one ...
Func GetImageDimensions($Filepath_Gif)
    $Filepath_Gif = FileGetLongName($Filepath_Gif); validate the passed GIF filepath.
    If @error Then Return SetError($GIF_FILE_NOTFOUND, 0, 0); passed file not found.
    Local $sFile = StringMid($Filepath_Gif, StringInStr($Filepath_Gif, "\", 0, -1) + 1)
    Local $sDir = StringLeft($Filepath_Gif, StringInStr($Filepath_Gif, "\", 0, -1) - 1)
    Local $oShellApp = ObjCreate("Shell.Application")
    If Not IsObj($oShellApp) Then Return SetError($GIF_OBJCREATE_ERROR, 0, 0)
;__ErrorHandlerRegister(); this is where to register an AutoIt Error Handler function
    Local $oDir = $oShellApp.NameSpace($sDir)
    Local $oFile = $oDir.Parsename($sFile)
    If Not IsObj($oFile) Then Return SetError($GIF_COM_ERROR, 0, 0)
    Local $sProperty = $oDir.GetDetailsOf($oFile, 26)
    Local $ImgDimensions = StringSplit($sProperty, " ")
    $ImgDimensions[0] = Number($ImgDimensions[1])
    $ImgDimensions[1] = Number($ImgDimensions[3])
    $oFile = 0
    $oShellApp = 0
;__GifErrorHandlerUnregister(); you could de-register the handler at this point.
    ReDim $ImgDimensions[2]
    Return SetError($GIF_SUCCESS, 0, $ImgDimensions)
EndFunc
Edited by Squirrely1

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites
Info

I love $WS_POPUPWINDOW style! :)

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  

×