Jump to content

Direct2D


trancexx
 Share

Recommended Posts

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

Link to comment
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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

trancexx,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

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

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...