The CreateDIBPatternBrush function creates a logical brush that has the pattern specified by the specified device-independent bitmap (DIB). The brush can subsequently be selected into any device context that is associated with a device that supports raster operations.
This function is provided only for compatibility with applications written for versions of Windows earlier than 3.0. For Win32-based applications, use the CreateDIBPatternBrushPt function.
HBRUSH CreateDIBPatternBrush(
HGLOBAL hglbDIBPacked, |
// handle to device-independent bitmap |
UINT fuColorSpec |
// color table data |
); |
Windows 95: Creating brushes from bitmaps or DIBs larger than 8x8
pixels is not supported. If a larger bitmap is specified, only a portion of
the bitmap is used.
Value |
Meaning |
DIB_PAL_COLORS |
A color table is provided and consists of an array of 16-bit indices into the logical palette of the device context into which the brush is to be selected. |
DIB_RGB_COLORS |
A color table is provided and contains literal RGB values. |
If the function succeeds, the return value identifies a logical brush.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
When an application selects a two-color DIB pattern brush into a monochrome device context, Windows does not acknowledge the colors specified in the DIB; instead, it displays the pattern brush using the current background and foreground colors of the device context. Pixels mapped to the first color of the DIB (offset 0 in the DIB color table) are displayed using the foreground color; pixels mapped to the second color (offset 1 in the color table) are displayed using the background color.
When you no longer need the brush, call the DeleteObject function to delete it.
BITMAPINFO, CreateDIBPatternBrushPt, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush, DeleteObject, SetBkColor, SetTextColor
See:
file: /Techref/os/win/api/win32/func/src/f08_18.htm, 4KB, , updated: 2001/6/26 11:23, local time: 2024/8/23 08:43,
3.144.107.94:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://piclist.com/tecHREF/os/win/api/win32/func/src/f08_18.htm"> CreateDIBPatternBrush</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to piclist.com! |
.