BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New brush style

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Kriss
Guest





PostPosted: Tue May 03, 2005 2:31 pm    Post subject: New brush style Reply with quote



Hi,
I want to fill a polygon with a specific pattern (not diagonal, ...).
How to create a new brush pattern ?
Or, more generally, how to paint with a brush using a black and white
bitmap; the white pixels given transparence ?

Than you for your help.
KG
Back to top
Mike D Sutton
Guest





PostPosted: Wed May 04, 2005 3:29 pm    Post subject: Re: New brush style Reply with quote



Quote:
I want to fill a polygon with a specific pattern (not diagonal, ...).
How to create a new brush pattern ?
Or, more generally, how to paint with a brush using a black and white
bitmap; the white pixels given transparence ?

Have a look at CreatePatternBrush() to create a brush from your bitmap, if you don't have a Bitmap already then you can
use either CreateBitmap() to create a monochrome Bitmap (it will also create Bitmap's at other depths, but
CreateCompatibleBitmap() or CreateDIBSection() should be used in those circumstances.)
Once you have your new pattern Brush, select that into your DC and draw away. When you're done de-select the Brush and
kill both that and the Bitmap and you're done.
If you want to paint the black pixels as transparent then you'll most likely need to set a Binary ROP on the target DC
using SetROP2(), I don't recall offhand exactly which one you want but just play until you get the desired result.
Hope this helps,

Mike


- Microsoft Visual Basic MVP -
E-Mail: [email]EDais (AT) mvps (DOT) org[/email]
WWW: Http://EDais.mvps.org/



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.