Sign in to follow this  
Followers 0
timmy2

Is it possible to simulate a dual-projector slide show using AutoIt?

18 posts in this topic

#1 ·  Posted (edited)

To save future readers a little sweat I'm editing my original post to insert the following:

After trying various suggested scripting approaches, some of which introduced new problems and some which had the same problem described here, I tried my script and a few others on another computer. No white flashes, tears, glitches. So I brought it back to my main box and disabled the Intel GPU that was feeding a 3rd monitor. Down to two monitors connected to a single NVidia GPU the visual glitches disappeared. Who would'a thought?!

That said, some of the replies that follow provide valuable insights into the various ways to skin this cat using AutoIt.  Some suggested scripts introduced new problems so they might be instructive about approaches to avoid. Ultimately, JohnOne suggested an elegantly simple script that perfectly accomplishes my goal.

---------------------

I want to display a  800x600 picture (i.e., not full-screen) without a border, close-box, title, etc.  I then want to replace that picture with another one -- cleanly. Think of an old-fashioned dual-projector slide show where there's no black-out or other interruption to the image on screen. This way I can start with a background image, then add elements to it seamlessly (once called "a build", i.e., pseudo-animation).  The image format doesn't matter to me.

I can't use an animated GIF or video because my code is doing things in the background between images, so timing varies.

I'm having bad luck using an AutoIt form to accomplish this (GUICtrlCreatePic, followed by subsequent GUICtrlSetImage's).  The result is a glitch -- usually a white flash or tear in the picture -- at almost every image change. (see 10/10/13 post entitled "random visual glitch when using GUICtrlSetImage"). So I guess that's out.

SplashImageOn  blanks out the first image before displaying the next (like a single-projector slide show), so it's not seamless -- plus there's still a tiny border visible.

$var = Default

SplashImageOn("","image1.bmp",$var,$var,$var,$var,1)
sleep(2000)
SplashImageOn("","image2.bmp",$var,$var,$var,$var,1)
sleep(2000)
SplashImageOn("","image3.bmp",$var,$var,$var,$var,1)
sleep(2000)

Any suggestions?

Edited by timmy2

Share this post


Link to post
Share on other sites



Have you tried using a borderless gui? I'm pretty sure images can be loaded and layered using GDI+


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Have you tried using a borderless gui? I'm pretty sure images can be loaded and layered using GDI+

 

Thank you for replying, kaotkbliss. 

Could you give me a simple example?   As I mentioned in my original post I've tried GuiCreate/GuiCtrlCreatePic/GuiCtrlSetImage but every GuiCtrlSetImage causes a tear/white flash in the image area -- so it's not clean. 

Maybe "GDI+" is different but I wouldn't know which "_GDIPlus..." commands would be applicable. Moreover, the help file seems a bit cryptic in this area. For example, "_GDIPlus_BitmapCreateFromFile" might be useful but I see no mention of options to make the GUI borderless, and the included example is rather complex and deals with saving a screen capture in a typical gui box.

Plus, I'm concerned that I could pursue trying to learn enough about GDI+ to replace what I did (see below) using the aforementioned GUI commands and end up discovering the result has similar problems.  I'm really surprised GUICtrlSetImage can't display an image over an existing one without tearing.

$form=GUICreate("Test",900,530,518,272, BitOR($WS_SYSMENU,$WS_POPUP), 0)
$cid=GUICtrlCreatePic(@ScriptDir & "\imagebackground.bmp", 0,0, 900, 530)
GuiCtrlSetState($cid,$GUI_DISABLE)

$PSimage=GUICtrlCreatePic(@ScriptDir & "\image1.bmp", 0,0,900,530)

GUISetState(@SW_SHOW)  ;show 1st image
MsgBox(0,"","test")    ;simulate doing some background business before next image is displayed

GUICtrlSetImage($PSimage, @ScriptDir & "\image2.bmp") ;show 2nd image
MsgBox(0,"","test")

GUICtrlSetImage($PSimage,@ScriptDir & "\image3.bmp")  ;show 3rd image
MsgBox(0,"","test")

GUICtrlSetImage($PSimage,@ScriptDir & "\image4.bmp")  'show 4th image
MsgBox(0,"","test")

Exit
Edited by timmy2

Share this post


Link to post
Share on other sites

Maybe slideshow gdiplus.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Also it might work better in a gui instead of splash, look into popup and borderless (can't remember the exact combination off hand but there's tons of examples here in the forums) styles for the guicreate options. Also, you can make the gui completely transparent if you have any troubles with edges


010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

You're probably thinking of the $WS_POPUP style for the GUI?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

:huh2: Why not actually do it the way a two projector setup would.

Load slide 1 in projector 1

turn on projector 1 lamp

load slide 2 in projector 2

wait for slide advance

turn on projector 2 lamp

turn off projector 1 lamp

load slide 3 in projector 1

wait for slide advance

etc...

#include <WindowsConstants.au3>

$form=GUICreate("Test",900,530,518,272, BitOR($WS_SYSMENU,$WS_POPUP), 0)

$PSimage1=GUICtrlCreatePic(@ScriptDir & "\image1.bmp", 0,0,900,530) ;load slide 1 for 'projector' 1
GUICtrlSetState($PSimage1, @SW_SHOW) ;show 'projector' 1

GUISetState(@SW_SHOW, $form) ; start showing it

$PSimage2=GUICtrlCreatePic(@ScriptDir & "\image2.bmp", 0,0,900,530) ;load slide 2 for 'projector' 2
GUICtrlSetState($PSimage1, @SW_HIDE) ;hide 'projector' 2

MsgBox(0, "slideshow", "slide 1") ;wait for slide advance

GUICtrlSetState($PSimage2, @SW_SHOW) ;show 'projector' 2
GUICtrlSetState($PSimage1, @SW_HIDE) ;hide 'projector' 1
GUICtrlSetImage($PSimage1,@ScriptDir & "\image3.bmp") ;load slide 3 for 'projector; 1

MsgBox(0, "slideshow", "slide 2") ;wait for slide advance

GUICtrlSetState($PSimage1, @SW_SHOW) ;show 'projector' 1
GUICtrlSetState($PSimage2, @SW_HIDE) ;hide 'projector' 2
GUICtrlSetImage($PSimage2,@ScriptDir & "\image4.bmp") ;load slide 4 for 'projector; 2

MsgBox(0, "slideshow", "slide 3") ;wait for slide advance

GUICtrlSetState($PSimage2, @SW_SHOW) ;show 'projector' 2
GUICtrlSetState($PSimage1, @SW_HIDE) ;hide 'projector' 1
;GUICtrlSetImage($PSimage1,@ScriptDir & "\image5.bmp") ;load slide 5 for 'projector; 1

MsgBox(0, "slideshow", "slide 4") ;wait for slide advance

Exit

No flash on my system when I tested it.

Edited by willichan
1 person likes this

Share this post


Link to post
Share on other sites

post-76101-0-58802900-1381553047_thumb.jpost-76101-0-07246100-1381553048_thumb.jpost-76101-0-50418100-1381553048_thumb.jpost-76101-0-77722600-1381553048_thumb.j

Thank you for the comprehensive reply!

The only problem with your script is that image3.jpg doesn't display. I've stared at the script for 15 minutes and feel like an idiot because your script is so simple and makes perfect sense, yet image4.jpg appears for "Slide 3" and for "Slide 4".  I've attached the sample images (jpeg's to keep file sizes small).  I did a search/replace in your script to replace .bmp with .jpg. Please try running this script with my images and tell me if you get the same result.  And, thank you again.

#include <WindowsConstants.au3>

$form=GUICreate("Test",900,530,518,272, BitOR($WS_SYSMENU,$WS_POPUP), 0)

$PSimage1=GUICtrlCreatePic(@ScriptDir & "\image1.jpg", 0,0,900,530) ;load slide 1 for 'projector' 1
GUICtrlSetState($PSimage1, @SW_SHOW) ;show 'projector' 1

GUISetState(@SW_SHOW, $form) ; start showing it

$PSimage2=GUICtrlCreatePic(@ScriptDir & "\image2.jpg", 0,0,900,530) ;load slide 2 for 'projector' 2
GUICtrlSetState($PSimage1, @SW_HIDE) ;hide 'projector' 2

MsgBox(0, "slideshow", "slide 1") ;wait for slide advance

GUICtrlSetState($PSimage2, @SW_SHOW) ;show 'projector' 2
GUICtrlSetState($PSimage1, @SW_HIDE) ;hide 'projector' 1
GUICtrlSetImage($PSimage1,@ScriptDir & "\image3.jpg") ;load slide 3 for 'projector; 1

MsgBox(0, "slideshow", "slide 2") ;wait for slide advance

GUICtrlSetState($PSimage1, @SW_SHOW) ;show 'projector' 1
GUICtrlSetState($PSimage2, @SW_HIDE) ;hide 'projector' 2
GUICtrlSetImage($PSimage2,@ScriptDir & "\image4.jpg") ;load slide 4 for 'projector; 2

MsgBox(0, "slideshow", "slide 3") ;wait for slide advance

GUICtrlSetState($PSimage2, @SW_SHOW) ;show 'projector' 2
GUICtrlSetState($PSimage1, @SW_HIDE) ;hide 'projector' 1
;GUICtrlSetImage($PSimage1,@ScriptDir & "\image5.jpg") ;load slide 5 for 'projector; 1

MsgBox(0, "slideshow", "slide 4") ;wait for slide advance

Exit

Share this post


Link to post
Share on other sites

#include <WindowsConstants.au3>

$form=GUICreate("Test",900,530,518,272, BitOR($WS_SYSMENU,$WS_POPUP), 0)

$PSimage4=GUICtrlCreatePic(@ScriptDir & "\image4.jpg", 0,0,900,530) ;load slide 1 for 'projector' 1
$PSimage3=GUICtrlCreatePic(@ScriptDir & "\image3.jpg", 0,0,900,530)
$PSimage2=GUICtrlCreatePic(@ScriptDir & "\image2.jpg", 0,0,900,530)
$PSimage1=GUICtrlCreatePic(@ScriptDir & "\image1.jpg", 0,0,900,530)
GUISetState(@SW_SHOW, $form) ; start showing it

MsgBox(0, "slideshow", "slide 1") ;wait for slide advance
GUICtrlDelete($PSimage1)

MsgBox(0, "slideshow", "slide 2") ;wait for slide advance
GUICtrlDelete($PSimage2)

MsgBox(0, "slideshow", "slide 3") ;wait for slide advance
GUICtrlDelete($PSimage3)

MsgBox(0, "slideshow", "slide 4") ;wait for slide advance


AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

@JohnOne - cleaner way of doing it:

#include <WindowsConstants.au3>

$form = GUICreate("Test", 900, 530, 518, 272, BitOR($WS_SYSMENU, $WS_POPUP), 0)

Global $PSimages[4]
For $i = UBound($PSimages) - 1 To 0 Step -1
    $PSimages[$i] = GUICtrlCreatePic(@ScriptDir & "\image" & $i + 1 & ".jpg", 0, 0, 900, 530)
Next
GUISetState(@SW_SHOW, $form) ; start showing it

For $i = 0 To UBound($PSimages) - 1
    MsgBox(0, "slideshow", "slide " & $i + 1) ;wait for slide advance
    GUICtrlDelete($PSimages[$i])
Next
Edited by DatMCEyeBall
1 person likes this

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Share this post


Link to post
Share on other sites

Pre-loading all of the images works well if there are only a small set, but if the slideshow has a lot of images, you will be using more memory that you may want to.

@timmy2:  I'll take a look at it.

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

datmc result.zippost-76101-0-34698600-1381599622_thumb.jpost-76101-0-77341400-1381599622_thumb.jpost-76101-0-27482500-1381599623_thumb.jpost-76101-0-60130000-1381599623_thumb.j

Thank you DatMCEyeBall and John One.  Using the jpegs I provided previously both of your scripts work with rarely a glitch (the exception being an occasional white flash before the first image ).

BUT... when I substitute my actual photographs, or even slightly more demanding images, problems become visible.  (Note that my Windows 8 background is a solid color: 80,80,80, in case that's a factor.)

DatMCEyeBall's script exhibits three problems:

1. the occasional white flash or tear before the first image, between images, and after the last image. See the attached Camtasia recording.

2. with the attached images you see all four images briefly load at the start

3. as you click through them you see a brief preview of the slide that will follow. I'll have to describe this issue because I couldn't capture it with Camtasia:  run the script, click OK on the first msg box, after that you'll see "Image 3" appear briefly followed by the desired "Image 2".  Likewise, "Image 4" appears briefly before "Image 3". This suggests that JohnOne's idea of loading up all four images ("controls") and removing them one by one allows controls underneath to briefly appear at each slide change.

I hope you don't take the foregoing as criticism; I created this post because I couldn't avoid the glitches between images with my code so I figured folks here with far more experience would know the secret recipe.  For me to try to learn GDI+ as one contributor suggested is daunting if it's just going to end up yielding the same problems, so I greatly appreciate the example code DatMCEyeBall and JohnOne provided.

Come to think of it, I should try this on another computer. The one I'm working on, albeit a zippy SSD-based 32GB I7-3770 with 3 monitors, is using a combination of an Nvidia card for two monitors and the built-in Intel GPU for the one that the script is running on. I'll try it on another less complicated rig and report back.(But since Camtasia captures the flashes I suspect these problems are hardware independent.)

Edited by timmy2

Share this post


Link to post
Share on other sites

Try this ex style

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>


$form=GUICreate("Test",900,530,518,272,BitOR($WS_SYSMENU,$WS_POPUP),$WS_EX_COMPOSITED)


$PSimage=GUICtrlCreatePic(@ScriptDir & "\image1.jpg", 0,0,900,530)
GUISetState(@SW_SHOW)
MsgBox(0,"","test")

GUICtrlSetImage($PSimage, @ScriptDir & "\image2.jpg")
MsgBox(0,"","test")

GUICtrlSetImage($PSimage,@ScriptDir & "\image3.jpg")
MsgBox(0,"","test")

GUICtrlSetImage($PSimage,@ScriptDir & "\image4.jpg")
MsgBox(0,"","test")

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

 

Try this ex style

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>


$form=GUICreate("Test",900,530,518,272,BitOR($WS_SYSMENU,$WS_POPUP),$WS_EX_COMPOSITED)


$PSimage=GUICtrlCreatePic(@ScriptDir & "\image1.jpg", 0,0,900,530)
GUISetState(@SW_SHOW)
MsgBox(0,"","test")

GUICtrlSetImage($PSimage, @ScriptDir & "\image2.jpg")
MsgBox(0,"","test")

GUICtrlSetImage($PSimage,@ScriptDir & "\image3.jpg")
MsgBox(0,"","test")

GUICtrlSetImage($PSimage,@ScriptDir & "\image4.jpg")
MsgBox(0,"","test")

 

Magnifique!  Seamless display of my actual images as well as all test images. No artifacts. No flashes. Nada.  Thank you, JohnOne! (would it help other readers for you to explain in simple terms why the "GUI double buffering" solved the problems -- if indeed that was the sole solution?)

um6i.jpg

Edited by timmy2

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  
Followers 0

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      Hi dear
      I have a question
      about the display language of the system
      How can I get the current display language and how can I change it by autoit
      Of course, if this is possible
      Greetings to all and hope you help me
    • Stormgrade
      By Stormgrade
      Hello,
      I want to use the "_ChangeScreenResEx()" UDF for changing my display settings from 1680*1050 to 1280*800.
      When I use it the display change to 1280*800 but with Intel Drivers, Scaling option change : Maintain display Scaling become Center Image.

      Here my Main program
      #include <.\_ChangeResolutionEx.au3> Global $Config = @ScriptDir & "\ChangeResolution.ini" Global $aSection = IniReadSectionNames($Config) Global $Moniteur,$Largeur,$Hauteur,$Profondeur,$Refresh for $i = 1 to $aSection[0] Step 1 $Moniteur = Number($i) $Largeur = Number(IniRead($Config,$i,"Width","1680")) $Hauteur = Number(IniRead($Config,$i,"Height","1050")) $Profondeur = Number(IniRead($Config,$i,"Bits","32")) $Refresh = Number(IniRead($Config,$i,"Refresh","60")) _ChangeScreenResEx($Moniteur,$Largeur,$Hauteur,$Profondeur,$Refresh) Sleep(1000) Next  _ChangeScreenResEx()
      #include-once ;=============================================================================== ; Function Name: _ChangeScreenResEx() ; Description: Changes the current screen geometry, colour and refresh rate. ; Version: 1.0.0.0 ; Parameter(s): $i_DisplayNum - Display to change, starting at 1 ; $i_Width - Width of the desktop screen in pixels. (horizontal resolution) ; $i_Height - Height of the desktop screen in pixels. (vertical resolution) ; $i_BitsPP - Depth of the desktop screen in bits per pixel. ; $i_RefreshRate - Refresh rate of the desktop screen in hertz. ; Requirement(s): AutoIt Beta > 3.1 ; Return Value(s): On Success - Screen is adjusted, @ERROR = 0 ; On Failure - sets @ERROR = 1 ; Forum(s): ; Author(s): Original code - psandu.ro, PartyPooper ; Modifications - bobchernow ;=============================================================================== Func _ChangeScreenResEx($i_DisplayNum = 1, $i_Width = @DesktopWidth, $i_Height = @DesktopHeight, $i_BitsPP = @DesktopDepth, $i_RefreshRate = @DesktopRefresh) Local Const $DM_PELSWIDTH = 0x00080000 Local Const $DM_PELSHEIGHT = 0x00100000 Local Const $DM_BITSPERPEL = 0x00040000 Local Const $DM_DISPLAYFREQUENCY = 0x00400000 Local Const $CDS_TEST = 0x00000002 Local Const $CDS_UPDATEREGISTRY = 0x00000001 Local Const $DISP_CHANGE_RESTART = 1 Local Const $DISP_CHANGE_SUCCESSFUL = 0 Local Const $HWND_BROADCAST = 0xffff Local Const $WM_DISPLAYCHANGE = 0x007E If $i_Width = "" Or $i_Width = -1 Then $i_Width = @DesktopWidth; default to current setting If $i_Height = "" Or $i_Height = -1 Then $i_Height = @DesktopHeight; default to current setting If $i_BitsPP = "" Or $i_BitsPP = -1 Then $i_BitsPP = @DesktopDepth; default to current setting If $i_RefreshRate = "" Or $i_RefreshRate = -1 Then $i_RefreshRate = @DesktopRefresh; default to current setting Local $DEVMODE = DllStructCreate("byte[32];int[10];byte[32];int[6]") Local $s_Display $s_Display = "\\.\Display" & $i_DisplayNum Local $B = DllCall("user32.dll", "int", "EnumDisplaySettings", "ptr", 0, "int", 0, "ptr", DllStructGetPtr($DEVMODE)) If @error Then $B = 0 SetError(1) Return $B Else $B = $B[0] EndIf If $B <> 0 Then DllStructSetData($DEVMODE, 2, BitOR($DM_PELSWIDTH, $DM_PELSHEIGHT, $DM_BITSPERPEL, $DM_DISPLAYFREQUENCY), 5) DllStructSetData($DEVMODE, 4, $i_Width, 2) DllStructSetData($DEVMODE, 4, $i_Height, 3) DllStructSetData($DEVMODE, 4, $i_BitsPP, 1) DllStructSetData($DEVMODE, 4, $i_RefreshRate, 5) $B = DllCall("user32.dll", "int", "ChangeDisplaySettingsEx","str", $s_Display, "ptr", DllStructGetPtr($DEVMODE), "hwnd", 0, "dword", $CDS_TEST, "lparam", 0) If @error Then $B = -1 Else $B = $B[0] EndIf Select Case $B = $DISP_CHANGE_RESTART $DEVMODE = "" Return 2 Case $B = $DISP_CHANGE_SUCCESSFUL DllCall("user32.dll", "int", "ChangeDisplaySettingsEx","str", $s_Display, "ptr", DllStructGetPtr($DEVMODE), "hwnd", 0, "dword", $CDS_UPDATEREGISTRY, "lparam", 0) DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND_BROADCAST, "int", $WM_DISPLAYCHANGE, _ "int", $i_BitsPP, "int", $i_Height * 2 ^ 16 + $i_Width) $DEVMODE = "" Return 1 Case Else $DEVMODE = "" SetError(1) Return $B EndSelect EndIf EndFunc;==>_ChangeScreenResEx Any idea how to get around this problem ?
      thanks for your answer.
    • KimberlyJillPereira
      By KimberlyJillPereira
      Using the alarm received parameter how to search for the picture that matches the year month day hour min and sec and by the name of the .jpg file the jpg file naming format is first letter is always m followed by last two digits of year then two digit month two digit day two digit hour two digit minute and two digit second then get that picture and paste it in Microsoft Excel.How to do it? Please help me. Thank you.



    • Skysnake
      By Skysnake
      Hello
      So I thought it would be cool to use my Gravatar account to display my gravatar in a local GUI.
      I use this code:
      #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: Skysnake Script Function: Example to download avatar from Gravatar and display locally #ce ---------------------------------------------------------------------------- ; Script Start ; includes #include <Crypt.au3> #include <InetConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> ; declare Global vars Global $md5GraMail = '' ; will store email for Grvatar request request GravatarLogin() GetAvatar() Func GravatarLogin() ; get the email required for downloading the Gravatar Local $sGraMail = InputBox("Get Gravatar", "What is your email registered with Gravatar?", "someone@somewhere.com", "", -1, -1, 0, 0) ; from http://en.gravatar.com/site/implement/hash/ ; make the hash ; Local $dHash = _Crypt_HashData(GUICtrlRead($g_idInputEdit), $g_iAlgorithm) ; Create a hash of the text entered $md5GraMail = _Crypt_HashData(StringLower(StringStripWS($sGraMail, 8)), $CALG_MD5) ; lose the left two '0x' chars and convert to lower case $md5GraMail = StringLower(StringTrimLeft($md5GraMail, 2)) ; Display the result. MsgBox($MB_SYSTEMMODAL, "", $sGraMail & @CRLF & "md5 " & $md5GraMail, 15) EndFunc ;==>GravatarLogin ; example from Help file: /html/functions/InetGet.htm ; Download a file in the background. ; Wait for the download to complete. Func GetAvatar() ; Save the downloaded file to the temporary folder. Local $sFilePath = _WinAPI_GetTempFileName(@TempDir) ; from http://en.gravatar.com/site/implement/images/ ; <img src="https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50" /> ; Download the file in the background with the selected option of 'force a reload from the remote site.' ; the next THREE options are alternatives ; Gravatar sample from here http://en.gravatar.com/site/implement/images/ ; 1 ;Local $hDownload = InetGet("https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) ; the normal code, should show user avatar ; 2 Local $hDownload = InetGet("https://www.gravatar.com/avatar/" & $md5GraMail & "?d=retro", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) ; my email hardcoded, downloads, but does not show avatar ; 3 ;Local $hDownload = InetGet("https://www.gravatar.com/avatar/cac637b47c9fecc8aa1dcdf71e7a4cc8", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND) ; Wait for the download to complete by monitoring when the 2nd index value of InetGetInfo returns True. Do Sleep(250) Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE) ; Retrieve the number of total bytes received and the filesize. Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD) Local $iFileSize = FileGetSize($sFilePath) ; Close the handle returned by InetGet. InetClose($hDownload) ; Display details about the total number of bytes read and the filesize. MsgBox($MB_SYSTEMMODAL, "", "The total download size: " & $iBytesSize & @CRLF & _ "The total filesize: " & $iFileSize, 1) Local $MyGravatar = @ScriptDir & "\Gravatar.jpg" FileCopy($sFilePath, $MyGravatar) MsgBox(0, "Now showing!", $MyGravatar, 5) ; make gui and show file GUICreate("My Gravatar in a GUI " & $MyGravatar, 350, 300, -1, -1, $WS_SIZEBOX + $WS_SYSMENU) ; will create a dialog box that when displayed is centered Local $idPic = GUICtrlCreatePic($MyGravatar, 50, 50, 80, 80) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ;FileDelete($MyGravatar) ; Delete the file. FileDelete($sFilePath) EndFunc ;==>GetAvatar Now, here is the issue.
      If I use the example from the Gravatar site, located here:
      http://en.gravatar.com/site/implement/images/
      Then this code  205e460b479e2e5b48aec07710c08d50  downloads this pic   (not me)
      AND it displays correctly.
       
      PROBLEM
      However, If I download my own Gravatar, I see the image in the @Script folder, BUT IT DOES NOT DISPLAY.  The same with the retro image.  To be clear, this image   downloads, but is not displayed.
       
      I guess it has something to do with the format of my gravatar. Or that the display funtion GUICtrlCreatePic() does not like my gravatar.
      I would be grateful if someone would be willing to test this and may offer a suggestion or two... 
      Skysnake
       
    • FrancescoDiMuro
      By FrancescoDiMuro
      Hi guys! How are you? Hope you're fine
      I'm trying to use SQLite for managing some data, and, I would like to display my "retrieved" data, but I'm trying to do a select from 2 table, and seems to not work properly...
      What I'd like to do is retrieve data from 2 tables and display in a listview...
      I tried with:
      Local $aRisultato, $iRighe, $iColonne, $iRVal $iRval = _SQLite_GetTable2d($hDatabase, "SELECT * FROM Magazzino_Rockwell, Magazzino_Siemens;", $aRisultato, $iRighe, $iColonne) If $iRVal = $SQLITE_OK Then ;_SQLite_Display2DResult($aRisultato) _ArrayDisplay($aRisultato) EndIf ... but it displays a single record 41 times, and it does this thing for every record in the database...
      What do you need to help me?
      Thanks  

      EDIT:
      Managed with a double If and double query like this:
       
      $iRval = _SQLite_GetTable2d($hDatabase, "SELECT * FROM Magazzino_Rockwell;", $aRisultato, $iRighe, $iColonne) If $iRVal = $SQLITE_OK Then Local $aRisultatoRockwell = $aRisultato $iRval = _SQLite_GetTable2d($hDatabase, "SELECT * FROM Magazzino_Siemens;", $aRisultato, $iRighe, $iColonne) If $iRVal = $SQLITE_OK Then _ArrayConcatenate($aRisultato, $aRisultatoRockwell) Local $i, $sRiga, $s_LV_Item For $i = 1 To Ubound($aRisultato) - 1 $sRiga = $aRisultato[$i][0] & "|" & _ $aRisultato[$i][1] & "|" & _ $aRisultato[$i][2] & "|" & _ $aRisultato[$i][3] & "|" & _ $aRisultato[$i][4] & "|" & _ $aRisultato[$i][5] & "|" & _ $aRisultato[$i][6] & "|" & _ $aRisultato[$i][7] & "|" & _ $aRisultato[$i][8] & "|" & _ $aRisultato[$i][9] & "|" & _ $aRisultato[$i][10] & "|" & _ $aRisultato[$i][11] $s_LV_Item = GUICtrlCreateListViewItem($sRiga, $lv_Lista) Next And so, the listview is created
      If anyone has another more efficient way, I'm here Thanks guys