Sign in to follow this  
Followers 0
mirko-stifler

Problem graphic object

5 posts in this topic

#1 ·  Posted (edited)


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

Share this post


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

Share this post


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

 

 

Share this post


Link to post
Share on other sites

Hello. Use _GDIPlus_GraphicsClear 

 

Saludos

Share this post


Link to post
Share on other sites

@mirko-stifler Stick to one topic please


√-1 2^3 ∑ π, and it was delicious!

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