Jump to content

Recommended Posts


Hello guys, I'm an Italian student! Sorry for my English :D

I have the need to create more graphic objects one after the other; especially when it appears a graphic object disappears the last. I had several problems and I can not solve them.

Const $iWidth = @DesktopWidth+4, $iHeight = @DesktopHeight, $iBgColor = 0x303030 ;$iBgColor formato RRGGBB
Local $Coord[4] = [800, 583, 820, 600] ; Pairs of coordinates x,y
 _GDIPlus_Startup() ; Inizialize GDI+
$hGUI = GUICreate("GDI+ Example (" & @ScriptName & ")", $iWidth, $iHeight) ;create a test GUI
GUISetBkColor($iBgColor, $hGUI) ;set color background GUI
GUISetState(@SW_SHOW)

$Numero = 0
    Do
       InizioRect( $Numero, $Coord)

$Numero = $Numero + 2
Until $Numero > 3

Edited by mirko-stifler
Link to post
Share on other sites


Hello guys, I'm an Italian student! Sorry for my English :D

I have the need to create more graphic objects one after the other; especially when it appears a graphic object disappears the last. I had several problems and I can not solve them.

Const $iWidth = @DesktopWidth+4, $iHeight = @DesktopHeight, $iBgColor = 0x303030 ;$iBgColor formato RRGGBB
Local $Coord[4] = [800, 583, 820, 600] ; Pairs of coordinates x,y
 _GDIPlus_Startup() ; Inizialize GDI+
$hGUI = GUICreate("GDI+ Example (" & @ScriptName & ")", $iWidth, $iHeight) ;create a test GUI
GUISetBkColor($iBgColor, $hGUI) ;set color background GUI
GUISetState(@SW_SHOW)

$Numero = 0
    Do
       InizioRect( $Numero, $Coord)

$Numero = $Numero + 2
Until $Numero > 3

Link to post
Share on other sites


Hello guys, I'm an Italian student! Sorry for my English :D

I have the need to create more graphic objects one after the other; especially when it appears a graphic object disappears the last. I had several problems and I can not solve them.

Const $iWidth = @DesktopWidth+4, $iHeight = @DesktopHeight, $iBgColor = 0x303030 ;$iBgColor formato RRGGBB
Local $Coord[4] = [800, 583, 820, 600] ; Pairs of coordinates x,y
 _GDIPlus_Startup() ; Inizialize GDI+
$hGUI = GUICreate("GDI+ Example (" & @ScriptName & ")", $iWidth, $iHeight) ;create a test GUI
GUISetBkColor($iBgColor, $hGUI) ;set color background GUI
GUISetState(@SW_SHOW)

$Numero = 0
    Do
       InizioRect( $Numero, $Coord) ; a function

       $Numero = $Numero + 2
Until $Numero > 3

 

 

Func InizioRect(ByRef $Numero, ByRef $Coord)
    $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;object graphics
    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; (antialiasing)
    $hPen = _GDIPlus_PenCreate(0xFFFEDCBA, 4) ;colore formato AARRGGBB (hex)

    Sleep(1000)

    _GDIPlus_GraphicsDrawRect($hGraphics, $Coord[$Numero], $Coord[$Numero+1], 200, 100, $hPen)
   Sleep (5000)
EndFunc

 

So to avoid that the figures are present both, making only appear as the current one can do? Thank you all

 

 

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...