Sign in to follow this  
Followers 0
RTFC

Digital Display (numeric readout)

14 posts in this topic

#1 ·  Posted (edited)

While developing a data visualisation tool I stumbled across >this awesome script by timmy2 and GDI grandwizard UEZ, and although I'm totally crap at graphics (craphics?), I had a stab at adapting it for more general use, incorporating some additional enhancements developed by more able graphics coders such as Beege, MrCreatoR and Malkey (acknowledgements and references to their relevant forum contributions are detailed in the script). Many thanks to you all! :bye: The result looks something like this:

DigitalDisplay_Example.png

So just to be absolutely clear: this is not my work, and I do not claim it to be my work. I've only repackaged it so you can easily create and maintain colourful displays like this with a few simple wrapper calls (see the example in the zip). Basically you create it once like a regular control (parse GUI handle, coordinates, size, and number of digits); that call then returns a display ID (1, 2, 3...). At this point the graphic is not yet visible. Internally, I've created specs storage for up to 100 displays; if you need more, just enlarge the array $DigiDispSpecs in the globals region.

Subsequently, once the GUI is itself visible, you can repeatedly update the displayed value (just make sure the value fits within the maximum number of digits specified when you created it; if parsing a value with fewer digits, these will be zero-padded). You can also change foreground colour, background colour, glow colour, and the intensity of that glow (range: 1-10; default 0 = off). You parse colour parameters either with colour strings ("red", "blue", "cyan", etc., easily expanded) or with their 6-digit hex RGB value (0xff0000 for red, for example). Remove individual readouts again by calling _DigitalDisplay_Remove($displayID). When you have removed the last digital display, you should call _DigitalDisplay_CleanUp() to avoid memory leaks. That's all, folks!

DigitalDisplay.7z beta version 0.9.

If it works, thank UEZ, timmy2, Beege, MrCreatoR and Malkey; if if breaks, blame me.

Hope you enjoy using it as much as I did cobbling it together! :)

RT

Edited by RTFC
3 people like this

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Nice work ;)

Works properly on Win 8.1. When using latest AutoIt version I'v to comment out several functions which are included now.

Btw, the zip archive seems to be corrupted.

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Hi UEZ,

Thanks a lot, but you did most of it, and what you are able to achieve with GDI is absolutely mind-blowing! I'm a big fan. :thumbsup:

Fixed the zip.

I know, I should upgrade to the latest release, but I really like stable work environments (if it ain't broke, don't fix it, right?) Spent the last two days struggling to get a cross-compiler ported from Win7 to OpenSuse :x , so then coming back to AutoIt and everything just works, it's so nice that I'm afraid to jinx it. Pathetic, I know...

Anyway, I'm learning a lot from analysing your scripts, gaining at least a little understanding, just enough to get by.

Thanks for the inspiration.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You are welcome. 

Nice to hear that at least somebody is inspired by the GDI+ stuff.  :thumbsup:

The latest beta should be stable regarding GDI+.

 

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

"Nice to hear that at least somebody is inspired by the GDI+ stuff."

(in my opinion) Extreme modesty.

It is great stuff!

Share this post


Link to post
Share on other sites

@lorenkinzel: Totally agree.

@UEZ: Actually, I'm kinda curious, UEZ. Do you perhaps have a professional background related to graphics processing (if it's not too personal), or are there extensive GDI tutorials to get one up to speed on this, or is it just a question of knuckling down on the MSDN materials, which I often find unhelpful and confusing? All this context-creating, internal conversions, and multiple handles (or so it seems to the uninitiated)... But when it works, it looks great, of course.

Share this post


Link to post
Share on other sites

@RTFC: I'm only an hobbyist coder with interests in graphical stuff and have no pro background. Everything I learned in GDI+ is owed to this forum and its pioneers of GDI+ (monoceres, Malkey, Smashly, Authenticity, etc.). Prerequisites are some basic understandings in maths (vectors, trigonometry, etc.). MSDN is hard to understand at the beginning.

Br,

UEZ

1 person likes this

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

updated to beta version 0.7.

Minor bug fixed: aspect ratio adjustments were implemented twice (i.e., adjustment was doubled).

Added: calling _DigitalDisplay_AspectRatio() without any arguments will reset $aspectratio to unity.

Note that calling DigitalDisplay_AspectRatio($value) will set $aspectratio to $value for all displays you subsequently define, until you reset it (see above), or parse it a new value.

Share this post


Link to post
Share on other sites

@RTFC: I'm only an hobbyist coder with interests in graphical stuff and have no pro background. Everything I learned in GDI+ is owed to this forum and its pioneers of GDI+ (monoceres, Malkey, Smashly, Authenticity, etc.). Prerequisites are some basic understandings in maths (vectors, trigonometry, etc.). MSDN is hard to understand at the beginning.

Br,

UEZ

My jaw just dropped! I would not have thought of you as merely a 'hobbyist coder' either!

I haven't been here in a few weeks, but the last thing I remember seeing in a search was this amazing looking clock  you did that even had gauges for CPU, Memory, etc.!  I was floored.  I'm still using the example clock that comes with Auto-it (with a little tweak). Haha!

You could probably write the manual on a GDI+!

In case I haven't said it recently, also thank you for all of your example scripts you contribute here! They've been a major help.

I wish I had more brain power...and minions....and a DeLorean. :-)

Share this post


Link to post
Share on other sites

coffeeturtle,

thanks for your compliments. Regarding GDI+ tutorials: well, when I was able to learn and use GDI+ from this forum and help file, everybody should be able to learn GDI+, too. ;)

To learn the basics in GDI+ the help file is a good place to start.

DeLorean? You wanna fly "back to the future"? ;)

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Great Scott!! :blink:

While I was writing this, I kept having this image in my head.

Strong meme, that.

RT

Edited by RTFC

Share this post


Link to post
Share on other sites

hehe, should be easy to do a mockup of that in autoit but with the current time and date. :)


2015 - Still no flying cars, instead blankets with sleeves.

Share this post


Link to post
Share on other sites

Update: beta version 0.8 released, for AutoIt 3.3.12.1.

This version should run in the latest AutoIt stable release 3.3.12.1, in which several previously-defined GDI-related functions are now internal. I've left these in (commented out) at the moment, for easy switching between versions. I've also left version 0.7 available for download for now, as the new version will not run in legacy environments. However, these legacy accommodations may disappear in future (as Im' running low on storage space).

Share this post


Link to post
Share on other sites

Update: beta version 0.9 released., with thanks to @LegitStack.

After the discussion here I realised that DPI rescaling also affects the canvas size for the readouts this UDF produces. That means that if your GUIs appear 20% bigger, then the bottom and right edges of the display were being clipped commensurately. So I added a simple adjustment to take care of this, shamelessly copied from LegitStack's code in the other thread (thanks!).;)

No other bells and whistles added, I'm afraid; still too busy battling the forces of darkness to keep your planet safe.:zorro:

2 people like this

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