Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CDC::SetPixel

Sets the pixel at the point specified to the closest approximation of the color specified by crColor.

COLORREF SetPixel( 
   int x, 
   int y, 
   COLORREF crColor  
); 
COLORREF SetPixel( 
   POINT point, 
   COLORREF crColor  
);
x

Specifies the logical x-coordinate of the point to be set.

y

Specifies the logical y-coordinate of the point to be set.

crColor

A COLORREF RGB value that specifies the color used to paint the point. See COLORREF in the Windows SDK for a description of this value.

point

Specifies the logical x- and y-coordinates of the point to be set. You can pass either a POINT structure or a CPoint object for this parameter.

An RGB value for the color that the point is actually painted. This value can be different from that specified by crColor if an approximation of that color is used. If the function fails (if the point is outside the clipping region), the return value is –1.

The point must be in the clipping region. If the point is not in the clipping region, the function does nothing.

Not all devices support the SetPixel function. To determine whether a device supports SetPixel, call the GetDeviceCaps member function with the RASTERCAPS index and check the return value for the RC_BITBLT flag.

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.