 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Kriss Guest
|
Posted: Tue May 03, 2005 2:31 pm Post subject: New brush style |
|
|
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
|
Posted: Wed May 04, 2005 3:29 pm Post subject: Re: New brush style |
|
|
| 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 |
|
 |
|
|
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
|
|