Jump to content

Recommended Posts

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

Posted

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

Posted

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:

My contributions:

  Reveal hidden contents

Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFsProcess CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen)Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery

Wrappers/Modifications of others' contributions:

_DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity)

UDF's added support/programming to:

_ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne)

(All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)

Posted

  On 11/3/2010 at 10:18 PM, 'Mat said:

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

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

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

  • Moderators
Posted

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:

  Reveal hidden contents

 

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

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

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
  • Recently Browsing   0 members

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