Sign in to follow this  
Followers 0
trancexx

Direct2D

35 posts in this topic

#1 ·  Posted (edited)

Direct2D is one of the new things that was implemented in Windows 7. Completely new technology built in the Microsoft factory.

You could say that GDI/GDI+ era ended with Windows 7, and guess what - you would be right.

Sooner you switch to Direct2D, the better. If you refuse however, you will be kicked off the field, not by the future but by the present time. May sound hard but that's the way things are. Just when you though you had something... :graduated:

In AutoIt's implementation of the Direct2D you would need AutoitObject since this is COM based technology.

What I'm introducing here is interface file. This file holds the definition of the interface (any kind, not just Direct2D). Extension is intfc.

This file is interpreted by the AutoIt's interpreter (executable) just as any au3 file, but it's not au3.

It's added to scripts with #include directive (should be done below #include "AutoitObject.au3" line).

People that have will can submit their interface files to me (trancexx at yahoo dot com) and I will add them to the AutoItObject package if they would meet required standards. You can use Direct2D.intfc as template (pay attention to organization of that file).

Anyway, Direct2D in AutoIt with few examples (Windows Animation and DirectWrite included).

Direct2D.zip

This is new to me too so don't be too harsh.

My advice to you is to at least get familiar with Direct2D. I'm serious.

edit: examples with correct objects releasing

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites



Wow, after D3D now D2D. :graduated: I'm enthused. :D

The question is now, which one is the best regarding complexity to learn, perfomance, etc.

If I understood both stuff I will do a benchmark to see the difference.:(

Well done trancexx!

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

Hah, I thought that Direct2D was referring to DirectDraw, so I was a bit confused. But looking into it, I can see how it works differently.. that and the new DirectWrite basically make simple text/shapes easier (and faster) to implement.

Anyway, kudos to you for keeping up with the DirectX interface. One day I'll find a use for it, I suppose.. though not in the AutoIt era (maybe a new phoenix will rise eh) :graduated:

Share this post


Link to post
Share on other sites

Yes, DirectWrite is brilliantly advanced, I have some scripts, maybe I post them if no one else would.

I'm glad you were one of those who were able to get me.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

I think that oo is definitely going to be needed in AutoIt for it to keep up... This is another example of that. Maybe you were right saying that it will soon be a 'dead' language. :graduated:

Works on vista though :(

Share this post


Link to post
Share on other sites

I think that oo is definitely going to be needed in AutoIt for it to keep up... This is another example of that. Maybe you were right saying that it will soon be a 'dead' language. :graduated:

Works on vista though :(

MSDN says "Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista". That's great, they have added it to an older OS. Speaks of importance.

About the implementation, considering the capability it would be best to process WM_ERASEBKGND and return 0 from it and keep only WM_PAINT. And forget most of the AutoIt GUI... stuff.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I've added another example just to show what I meant with WM_ERASEBKGND.

It's more complex too, with stroke and other things like the net in the background and gradient for example.

edit: try resizing now.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I've added few more examples if you would be interested.

Example5 includes Windows Animation (another new thing). Animation of the background color changing fired on mouse click.

Few interface definitions added to the package for easier manipulation with the objects.

Also, custom interface implementation example for handling different events included (needles to say; must try!).

Believe it or not, this pushes AutoIt to be ...meh, whatever. Who cares anyway.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

trancexx,

I get a file with no extension extracted from the zip. I am sure that is not what should happen. :graduated:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

What's the name of it?


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Apparently yes.

No, it wasn't much so I dropped it.

btw, thanks for the feedback.

Edited by trancexx

♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

trancexx,

The file was seemingly double zipped - renaming the extracted file with a zip extension allowed me to finally extract the files. :(

Clever stuff from you as always - although it does make my head hurt looking at the code. :graduated:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

It shouldn't be double zipped. It's just zipped folder (not file) containing examples and other things.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Also to you, thanks for the update!

Great work as usual!

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

Once upon a time, there was... - that's a line from example No4. It shows how to draw text using DirectWrite.

So, there are 5 examples now showing the basics of Direct2D, DirectWrite and Windows Animation.

New version of AutoItObject v1.2.1.0, viz. included in the zip from the first post, is required. Don't miss this release, it's totally groovy! Visit http://autoitobject.origo.ethz.ch/ (mainly download section) to see why.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Yep, that's how that fairy tale goes.


♡♡♡

.

eMyvnE

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