Mini Gauges
Task was clear, to make minimalist gauges of icon size
Source: http://www.ctvrtky.info/wp-content/uplo ... Gauges.tar
Mini Gauges
Re: Mini Gauges
l1marik,
I love your series of gauges - please keep them coming! One question:
Why is the statement in the drawing loop in the procedure ImageToColor()? I commented it out and it has no effect.
Regards,
Eric
I love your series of gauges - please keep them coming! One question:
Why is the statement
Code: Select all
gray = Point(x, y)
Regards,
Eric
Re: Mini Gauges
You should definately use EnableExplicit.
To avoid an error you should use some checks:
Else if you reduce the window to the titlebar it results in an error.
And why not 'own' gadgets instead of drawing?
Than you can avoid the resizing commands. This can be done automatically. (If you want it)
To avoid an error you should use some checks:
Code: Select all
If IsGadget(parent_canvas)
If GadgetWidth(parent_canvas) > 0
If StartVectorDrawing(CanvasVectorOutput(parent_canvas))
And why not 'own' gadgets instead of drawing?
Than you can avoid the resizing commands. This can be done automatically. (If you want it)
Re: Mini Gauges
Dear Eric, it is some rest in the code, thank you for notice.ebs wrote:l1marik,
I love your series of gauges - please keep them coming! One question:
Why is the statementin the drawing loop in the procedure ImageToColor()? I commented it out and it has no effect.Code: Select all
gray = Point(x, y)
Regards,
Eric
Lukas
Re: Mini Gauges
Dear infratec, answer is simple, for demo I wrote code as minimally needed, without any extra checking. For final application it is different story.infratec wrote:You should definately use EnableExplicit.
To avoid an error you should use some checks:Else if you reduce the window to the titlebar it results in an error.Code: Select all
If IsGadget(parent_canvas) If GadgetWidth(parent_canvas) > 0 If StartVectorDrawing(CanvasVectorOutput(parent_canvas))
And why not 'own' gadgets instead of drawing?
Than you can avoid the resizing commands. This can be done automatically. (If you want it)
Lukas
Re: Mini Gauges
Hi,
Codes for the forum should always be as perfect as possible.
Beginners look at the codes or take them over completely.
Bad programming style is thus inherited.
Therefore, always document the codes well.
EnableExplicit is a "Must have" for every code that is made available to others.
Only beginners or unteachable people do without it.
There are then quickly no more answers or ratings from other users.
The interest in such codes diminishes very quickly.
The problem with the low priority of the window timers can unfortunately
not be solved by using BindEvent() it just shift the problem a little.
If you want to use window timers, it is best to set only one.
This one can then be divided into several.
Using threads forces the user to create a thread safe executable, so I avoid this completely.
If you want to do this, you are probably more experienced and can add it yourself.
But for the cyclic execution of a multi timer it is not necessary, at least not for my code.
Best Regards Saki
Codes for the forum should always be as perfect as possible.
Beginners look at the codes or take them over completely.
Bad programming style is thus inherited.
Therefore, always document the codes well.
EnableExplicit is a "Must have" for every code that is made available to others.
Only beginners or unteachable people do without it.
There are then quickly no more answers or ratings from other users.
The interest in such codes diminishes very quickly.
The problem with the low priority of the window timers can unfortunately
not be solved by using BindEvent() it just shift the problem a little.
If you want to use window timers, it is best to set only one.
This one can then be divided into several.
Using threads forces the user to create a thread safe executable, so I avoid this completely.
If you want to do this, you are probably more experienced and can add it yourself.
But for the cyclic execution of a multi timer it is not necessary, at least not for my code.
Best Regards Saki
地球上の平和