Click here to Skip to main content
Click here to Skip to main content

A cool GDI pattern brush tool with C++ source code

, 27 Aug 2003
Rate this:
Please Sign up or sign in to vote.
A cool GDI pattern brush tool with C++ source code, You can create a new office xp style pattern fill mode quickly


This article shows how to use a pattern brush to give your application a similar look and feel, and it also includes a pattern brush bits tool, with this tool you can create a new style of pattern brush very quickly.

How to use it

The steps for usage are as follows:

  • Run application brushtool.exe.
  • Click on the left design panel to draw a style, you can click >> button to preview the style.
  • Click copy button to copy the bits to clipboard.
  • Call the following code to use the pattern brush. (You can paste the brush bits to the red field)


WORD m_bitsBrush1[8] = { 0xee,0xed,0xeb,0xe7,0xef,0xff,0xff,0xff };

CBrush brush,*pOldbrush;
CBitmap bm;

LOGBRUSH logBrush;
logBrush.lbStyle = BS_PATTERN;
logBrush.lbHatch = (int) bm.GetSafeHandle();
logBrush.lbColor = RGB(0,0,0);

int savedc = dc.SaveDC();


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author


China China
No Biography provided

Comments and Discussions

GeneralColor and Transparency Pinmemberfoufou27-Apr-08 1:11 
GeneralReally a nice article PinmemberSaRath 21-May-06 20:28 
GeneralRe: Really a nice article Pinmemberjoyjjjz25-Sep-08 18:20 
GeneralA little imagination goes a long way!! PinmemberWREY29-Aug-03 17:51 
GeneralUsability suggestion PinmemberYoSilver29-Aug-03 0:05 
GeneralRe: Usability suggestion Pinmemberucc80129-Aug-03 1:09 
GeneralGreat tool! PinsussAnonymous28-Aug-03 5:03 
GeneralRe: Great tool! PinmemberWarren Stevens28-Aug-03 8:13 
GeneralAnonymous = comment by author Pinmemberdog_spawn28-Aug-03 15:58 
GeneralRe: Anonymous = comment by author Pinmemberdang!28-Aug-03 18:24 
Generalheh Pinmemberdog_spawn28-Aug-03 19:52 
GeneralRe: heh PinmemberErnest Laurentin29-Aug-03 5:10 
GeneralSuggestion Pinmemberdog_spawn28-Aug-03 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150414.1 | Last Updated 28 Aug 2003
Article Copyright 2003 by ucc801
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid