October 8, 2009
Using Direct2D in Delphi 2010
I'm experimenting with Direct2D support in Windows 7 and Delphi 2010, as I'm working on the chapter of my coming "Delphi 2010 Handbook" devoted to the VCL and Windows 7. After spending a couple of days on the subject, I decided to share with my blog readers the output one of the examples. In this specific case I'm using a round gradient brush based on 4 colors for the background and a very similar gradient for the font brush. I'm also rotating the text with a transformation matrix and dimming it using opacity. The result is depicted in the image below.
That's a long way to go from original GDI-based form painting and I have to say Direct2D and the related technologies are really quite powerful. Too bad such a program will run only on Windows 7!
I'm wondering if it would make sense to grab all of the output images of the book and post them online (to Picasa, Facebook, or any other picture repository) as images like this make little sense when printed at grayscale in the book. This one I've actually decided to omit from the book altogether. Or maybe get back to the idea of shooting videos for most examples... Back to the book now.
10 Comments
Using Direct2D in Delphi 2010
Keep the examples in the book but post the full color versions of the pictures on the web. Low res black and white versions in the book.Comment by Tom L on October 9, 02:12
Using Direct2D in Delphi 2010
Very cool Marco. Looking forward to the book. I note that Direct2D for Vista is also in beta at the moment: http://support.microsoft.com/kb/971644, but as it depends on DirectX 10, it won't go as far back as XP.Comment by Malcolm Groves [http://www.malcolmgroves.com/blog] on October 9, 03:11
Using Direct2D in Delphi 2010
Not sure if you notice that Windows Vista will also support Direct2D, http://support.microsoft.com/kb/971644Comment by Lex Li [http://blogs.msdn.com/lexli] on October 9, 06:44
Using Direct2D in Delphi 2010
Regarding Drirect2D vs. GDI here is an interesting link with some great explanations: Comparing Direct2D and GDI http://blogs.msdn.com/directx/archive/2009/09/29/comparing-direct2d-and-gdi.aspx I already installed my "SA-delivered" Delphi 2010 ... and I'm very happy with it. I think it is the best Delphi ever, being very-very fast and with all the included comps & features is an absolute win over any other devel tool (VS, Eclipse...etc) ! Using this "Real RAD tool" to create cross-platform native software (Linux, OS-X, ...and maybe Android, IPhone, WMobile) will be just a dream (come-true hopefully) ! Any hints when your new D2010 book will be ready ? I already have the older one (2007, in paper form) and the format/structure is just great ! Do you (+Embarcadero) have in mind a similar "2009 deal" but this time to made the PDF 2010 version freely available for any D2010 owner ? 10x Marco for your continuous Delphi commitment and playing with it on the edge. Keep us informed what's cooking in the labs ;)Comment by El Cy on October 9, 10:07
Using Direct2D in Delphi 2010
Perhaps you can use one colored example for the cover? Perhaps better: On the cover. place a screenshot of a demo programm with a nice UI to experiment with Direct2D and the picture from above in the main window. So a potential buyer think: That all can I do when I have read the book. :-)Comment by Heinz Z. on October 9, 11:56
Using Direct2D in Delphi 2010
If you want to experience Direct2d in windows vista use the transition pack for windows vista: http://blogs.msdn.com/directx/archive/2009/09/10/windows -7-transition-pack-for-windows-vista.aspx Problem: Delphi2010 only attempt to run Direct2d on windows 7.Comment by Francisco Ruiz [] on October 9, 13:34
Using Direct2D in Delphi 2010
I´m hopping you could publish a site like Alister's site (http://codegearguru.com/), but with videos related to your books with lot's of examples. Hope you like the idea.Comment by Felipe Piña Arjona on October 10, 20:05
Using Direct2D in Delphi 2010
It's a long way from GDI, yes. But you can get the same result with GDI+. Might be that Direct2D is faster than GDI+ though. Have you tested this?Comment by Victor on October 12, 09:56
Using Direct2D in Delphi 2010
Victor: "Direct2D (or D2D) is a native immediate-mode 2D graphics rendering API that is built on top of Direct3D, and offers some compelling performance and visual quality improvements over GDI and GDI+." Direct2D is a nice opportunity for native developers, but it won't solve a lot of problems inherited from Win32 object model. Windows Presentation Foundation/Silverlight's power is the deeply extensible object model. You can easily customize anything and don't have to use graphic primitives/graphic api functions. But indeed, Direct2D hardware acceleration is a great thing.Comment by daywalker [http://janosjanka.spaces.live.com] on October 15, 21:39
Post Your Comment
Click here for posting your feedback to this blog.
There are currently 0 pending (unapproved) messages.






Using Direct2D in Delphi 2010
Comment by Luigi D. Sandon on October 8, 22:56