Jump to content
Sign in to follow this  
iamtheky

GDI slideshow

Recommended Posts

What is the proper method to prevent the GUI from clearing the last image while the next is being drawn. The behavior is only intermittent (more often it seems with the DrawImageRectRect), and i want to guess buffering, but my GDI skills are teh suck. In the beginning stages so all suggestions are welcome, thanks.

#include <GDIPlus.au3>
#include <WindowsConstants.au3>


$pic1 = "C:\green.jpg"
$pic2 = "C:\space.jpg"
$pic3 = "c:\preupdating.bmp"
$pic4 = "c:\weep.jpg"
$pic5 = "C:\chokes.jpg"


_GDIPlus_Startup()
Local $hGUI = GUICreate("Test", @DesktopWidth , @DesktopHeight, 0 , 0 ,$WS_POPUPWINDOW)
Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)

GUISetState()


Local $hBmp = _GDIPlus_BitmapCreateFromGraphics(@DesktopWidth , @DesktopHeight, $hGraphics)
Local $hBmpGraphics = _GDIPlus_ImageGetGraphicsContext($hBmp)

$hgreen = _GDIPlus_ImageLoadFromFile($pic1)
_GDIPlus_GraphicsDrawImageRECT($hBmpGraphics, $hgreen, 0 , 0 , @DesktopWidth , @DesktopHeight)
_GDIPlus_GraphicsDrawImage($hGraphics, $hBmp, 0, 0)

sleep (2000)

;~ ;;;;;;;;;;;;;;;;;;;;;;;;;;

$hspace = _GDIPlus_ImageLoadFromFile($pic2)
_GDIPlus_GraphicsDrawImageRECT($hBmpGraphics, $hspace, 0 , 0 , @DesktopWidth , @DesktopHeight)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


for $i = @DesktopWidth to 0 step -1

_GDIPlus_GraphicsDrawImage($hGraphics, $hBmp, $i, 0)

next

sleep (2000)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$hupdating = _GDIPlus_ImageLoadFromFile($pic3)
_GDIPlus_GraphicsDrawImageRECT($hBmpGraphics, $hupdating, 0 , 0 , @DesktopWidth , @DesktopHeight)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



for $i = @DesktopHeight to 0 step -1

_GDIPlus_GraphicsDrawImage($hGraphics, $hBmp, 0, $i)

next

sleep (2000)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$hweep = _GDIPlus_ImageLoadFromFile($pic4)
_GDIPlus_GraphicsDrawImageRECT($hBmpGraphics, $hweep, 0 , 0 , @DesktopWidth , @DesktopHeight)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



for $i = @DesktopWidth to 0 step -1

_GDIPlus_GraphicsDrawImageRectRect ($hGraphics, $hBmp, 0 , 0 , @DesktopWidth , @DesktopHeight , 0 , 0 , @DesktopWidth - $i , @DesktopHeight)
next

sleep (2000)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$hchoke = _GDIPlus_ImageLoadFromFile($pic5)
_GDIPlus_GraphicsDrawImageRECT($hBmpGraphics, $hchoke, 0 , 0 , @DesktopWidth , @DesktopHeight)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



for $i = @DesktopHeight to 0 step -1

_GDIPlus_GraphicsDrawImageRectRect ($hGraphics, $hBmp, 0 , 0 , @DesktopWidth , @DesktopHeight , 0 , 0 , @DesktopWidth , @DesktopHeight - $i)
next

sleep (2000)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


_GDIPlus_GraphicsDispose($hBmpGraphics)
_GDIPlus_BitmapDispose($hBmp)
_GDIPlus_GraphicsDispose($hGraphics)
GUIDelete()
_GDIPlus_Shutdown()

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...