The SelectObject function selects an object into the specified device context. The new object replaces the previous object of the same type.
HGDIOBJ SelectObject(
|
HDC hdc, |
// handle of device context |
|
HGDIOBJ hgdiobj |
// handle of object |
|
); |
|
Object |
Functions |
|
Bitmap |
CreateBitmap, CreateBitmapIndirect, CreateCompatibleBitmap, CreateDIBitmap, CreateDIBSection |
|
(Bitmaps can be selected for memory device contexts only, and for only one device context at a time.) | |
|
Brush |
CreateBrushIndirect, CreateDIBPatternBrush, CreateDIBPatternBrushPt, CreateHatchBrush, CreatePatternBrush, CreateSolidBrush |
|
Font | |
|
Pen | |
|
Region |
CombineRgn, CreateEllipticRgn, CreateEllipticRgnIndirect, CreatePolygonRgn, CreateRectRgn, CreateRectRgnIndirect |
If the selected object is not a region and the function succeeds, the return value is the handle of the object being replaced. If the selected object is a region and the function succeeds, the return value is one of the following values:
|
Value |
Meaning |
|
SIMPLEREGION |
Region consists of a single rectangle. |
|
COMPLEXREGION |
Region consists of more than one rectangle. |
|
NULLREGION |
Region is empty. |
If an error occurs and the selected object is not a region, the return value is NULL. Otherwise, it is GDI_ERROR.
This function returns the previously selected object of the specified type. An application should always replace a new object with the original, default object after it has finished drawing with the new object.
An application cannot select a bitmap into more than one device context at a time.
CombineRgn, CreateBitmap, CreateBitmapIndirect, CreateBrushIndirect, CreateCompatibleBitmap, CreateDIBitmap, CreateDIBPatternBrush, CreateEllipticRgn, CreateEllipticRgnIndirect, CreateFont, CreateFontIndirect, CreateHatchBrush, CreatePatternBrush, CreatePen, CreatePenIndirect, CreatePolygonRgn, CreateRectRgn, CreateRectRgnIndirect, CreateSolidBrush, SelectClipRgn, SelectPalette
See:
| file: /techref/os/win/api/win32/func/src/f75_10.htm, 6KB, , updated: 2001/6/26 11:22, local time: 2010/3/21 09:06,
38.107.191.111:LOG IN
|
| ©2010 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? Please DO link to this page! Digg it! <A HREF="http://www.piclist.com/techref/os/win/api/win32/func/src/f75_10.htm"> SelectObject</A> |
| Did you find what you needed? |
|
o List host: MIT, Site host massmind.org, Top posters @20100321 ivp, Vitaliy, Russell McMahon, Xiaofan Chen, Dario Greggio, Wouter van Ooijen, Alan B. Pearce, Bob Blick, YES NOPE9, M. Adam Davis, * 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: Shultz Electronics, Timothy Weber, on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
|
.