ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Challenge
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Dec 16 2013 :  11:09:18  Show Profile  Reply
Here is an interesting but simple challenge.
See the code that draws a grid on a transparent bitmap here:
http://www.imageen.com/ieforum/topic.asp?whichpage=1&TOPIC_ID=1365#4874
The challenge is to speed up the drawing.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html

spetric

Croatia
308 Posts

Posted - Dec 18 2013 :  06:15:12  Show Profile  Reply
I often use grid, but as vectorial objects (iekLine), so I can hide or show grid as necessary.

So, maybe the faster way would be:

1) Create vectorial grid with pen color set to clWhite (0xff)
2) IenVect->IEBitmap->Fill(0); // fill complete image with clBlack
3) IenVect->IEBitmap->AlphaChannel->Fill(0); // erase alpha channel
4) Set antialiasing as needed.
5) Render objects to AlphaChannel: IenVect->DrawObjectsToBitmap(IenVect->IEBitmap->AlphaChannel);
6) remove or hide objects


Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: