37 p =
new TPalette(
reinterpret_cast<HPALETTE
>(::GetStockObject(DEFAULT_PALETTE)));
61 TDib(handle, autoDelete)
94 TDib(width, height, nColors, mode)
137 TDib(file, readFileHeader)
147 TDib(is, readFileHeader)
189 LOGPALETTE* logPal =
reinterpret_cast<LOGPALETTE*
>(
new uint8[
190 sizeof(LOGPALETTE)+(nColors-1)*
sizeof(PALETTEENTRY) ]);
191 logPal->palVersion = 0x300;
192 logPal->palNumEntries =
static_cast<uint16>(nColors);
200 palette.GetPaletteEntries(0, uint16(nColors), logPal->palPalEntry);
201 for (colorIndex=0; colorIndex < nColors; colorIndex++)
202 logPal->palPalEntry[colorIndex].peFlags = PC_NOCOLLAPSE;
206 logPal->palPalEntry[0].peRed = 0;
207 logPal->palPalEntry[0].peGreen = 0;
208 logPal->palPalEntry[0].peBlue = 0;
209 logPal->palPalEntry[0].peFlags = 0;
213 logPal->palPalEntry[255].peRed = 255;
214 logPal->palPalEntry[255].peGreen = 255;
215 logPal->palPalEntry[255].peBlue = 255;
216 logPal->palPalEntry[255].peFlags = 0;
221 int staticColors = sdc.GetDeviceCaps(NUMCOLORS) / 2;
222 int usableColors = nColors - staticColors;
228 sdc.GetSystemPaletteEntries(0, staticColors, logPal->palPalEntry);
229 palette.GetPaletteEntries(0, uint16(usableColors), logPal->palPalEntry+staticColors);
230 sdc.GetSystemPaletteEntries(nSysColors - staticColors, staticColors,
231 logPal->palPalEntry + nSysColors - staticColors);
234 for (; colorIndex < staticColors; colorIndex++)
235 logPal->palPalEntry[colorIndex].peFlags = 0;
236 for (; colorIndex < nColors; colorIndex++)
237 logPal->palPalEntry[colorIndex].peFlags = PC_NOCOLLAPSE;
238 for (; colorIndex < nSysColors; colorIndex++)
239 logPal->palPalEntry[colorIndex].peFlags = 0;
241 Handle = ::CreatePalette(logPal);
TBitmap(HBITMAP handle, TAutoDelete autoDelete=NoAutoDelete)
Construct an alias TBitmap for an existing bitmap handle.
The clipboard class encapsulates the methods for the clipboard object of Windows.
HBITMAP CreateDIBSection(const BITMAPINFO &info, uint usage, void **bits, HANDLE section=0, uint32 offset=0)
Create a fast DIB under Win32.
virtual int GetDeviceCaps(int index) const
Used under WIN3.1 or later, GetDeviceCaps returns capability information about this DC.
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
int RealizePalette()
Maps to the system palette the logical palette entries selected into this DC.
uint GetSystemPaletteUse() const
Determines whether this DC has access to the full system palette.
void InitBitmap()
Initializes our bitmap side from the DIB side.
~TDiBitmap()
Restore Bits data member to 0.
TDiBitmap(HGLOBAL handle, TAutoDelete autoDelete=NoAutoDelete)
Construct from existing bitmap handle.
uint16 Usage() const
Returns the Mode for this DIB.
void CheckValid(uint resId=IDS_GDIFAILURE)
const BITMAPINFO * GetInfo() const
Returns this DIB's Info field.
TDib(HGLOBAL handle, TAutoDelete autoDelete=NoAutoDelete)
Creates a TDib object and sets the Handle data member to the given borrowed handle.
long NumColors() const
Returns NumClrs, the number of colors in this DIB's palette.
uint32 SizeImage() const
Returns number of bytes used to store the image.
The TFile class encapsulates standard file characteristics and operations.
HANDLE Handle
GDI handle of this object.
void CheckValid(uint resId=IDS_GDIFAILURE)
bool ShouldDelete
Should object delete GDI handle in dtor?
static void RefAdd(HANDLE handle, TType type)
RefAdd adds a reference entry for the object with the given handle and type.
HANDLE Handle
GDI handle of this object.
THalftonePalette()
Default constructor. Retrieves the system's halftone palette.
TIdentityPalette(const TPalette &palette)
Implementation of Identity Palette object, TIdentityPalette.
TPalette is the GDI Palette class derived from TGdiObject.
TPalette(HPALETTE handle, TAutoDelete autoDelete=NoAutoDelete)
Alias an existing palette handle. Assume ownership if autoDelete says so.
uint16 GetNumEntries() const
Returns the number of entries in this palette, or 0 if the call fails.
Smart pointer to a single object. Provides member access operator ->.
Derived from TWindowDC, TScreenDC is a DC class that provides direct access to the screen bitmap.
Definition of DeviceIndependent Bitmap object class.
Definition of abstract GDI object class and derived classes.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Object Windows Library (OWLNext Core).
Various types of smart pointer templatized classes.
Classes for window system structure and type encapsulation.