Jump to content

redraw graphics


CalibeR50
 Share

Recommended Posts

Hi, I searched for hours but didn't found a solution for my problem, I hope you can help me.

I just need a GUI with some graphics (cirles or rects). The position and size doesn't matter.

Now I first want to remove all graphics and create new ones (not the same quantity) on another position with other attributes.

It can't be that hard, but I really didn't found anything, so please paste me a simple code and I'll understand.

Thank you

CalibeR50

PS: Sorry for my English, it's late...

Edited by CalibeR50
Link to comment
Share on other sites

Look at _GDIPlus_GraphicsClear if working with alpha blend

and WM_PAINT message to redraw the window

Edit - Example

#include <GDIPlus.au3>

_GDIPlus_Startup()
Global $Hgui=GUICreate('Testing | Phoenix XL',500,400)
Global $nGfx=_GDIPlus_GraphicsCreateFromHWND($Hgui)
GUIRegisterMsg(0xF,'Paint')
GUISetState()
While GUIGetMsg()<>-3
Sleep(10)
WEnd
_GDIPlus_GraphicsDispose($nGfx)
_GDIPlus_Shutdown()
GUIDelete()

Func Paint()
_GDIPlus_GraphicsDrawEllipse($nGfx,10,10,100,100)
_GDIPlus_GraphicsDrawRect($nGfx,200,200,200,100)
EndFunc
Edited by PhoenixXL

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

A similar example with in-built functions

#include <GUIConstantsEx.au3>

GUICreate('Testing | Phoenix XL',500,400)
$hGfx1=GUICtrlCreateGraphic(20,20,110,110)
GUICtrlSetGraphic(-1,$GUI_GR_RECT,0,0,90,90)
$hGfx2=GUICtrlCreateGraphic(200,200,200-10,200-10)
GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE,0,0,90,90)
GUISetState()
While GUIGetMsg()<>-3
Sleep(10)
WEnd
GUIDelete()

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
Share on other sites

In post 2 the func Paint is always called hence refreshed

in post 3 the in-built controls handle redrawing and repainting internally ;)

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...