OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
dibdc.cpp
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1992, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Implementation of TDibDC encapsulation class
7//----------------------------------------------------------------------------
8#include <owl/pch.h>
9#include <owl/dc.h>
10#include <owl/gdiobjec.h>
11
12namespace owl {
13
15DIAG_DECLARE_GROUP(OwlGDI); // General GDI diagnostic group
16
17//
18// Construct a DC that can be used with DI Bitmaps. Under Win32 bitmaps
19// selected must be DIBSections
20//
22:
23 TMemoryDC()
24{
25 CheckValid();
26}
27
28//
29/// Constructs a DC that can be used with DI Bitmaps, then auto select the given
30/// bitmap in. Under Win32 bitmaps selected must be DIBSections
31//
39
40
41//
42// Get the color table of the currently selected bitmap.
43//
44uint
46{
47 return ::GetDIBColorTable(GetHDC(), start, count, colors);
48}
49
50//
51// Set the color table of the currently selected bitmap.
52//
53uint
55{
56# if defined(__GNUC__)
57 return ::SetDIBColorTable(GetHDC(), start, count, (RGBQUAD*)colors);
58# else
59 return ::SetDIBColorTable(GetHDC(), start, count, colors);
60# endif //WINELIB
61}
62
63
64//
65// Dib Screen Update BitBlt's. A screen DC must be the destination.
66// BitBlts from this DIB onto the destination DC.
67//
68bool
70{
71 return dstDC.BitBlt(dst, *this, src);
72}
73
74//
75// BitBlts from this DIB onto the destination DC.
76//
77bool
79 int srcX, int srcY) const
80{
81 return dstDC.BitBlt(dstX, dstY, dstW, dstH, *this, srcX, srcY);
82}
83
84//
85// Stretches the DIB onto the destination DC.
86//
87bool
89{
90 return dstDC.StretchBlt(dst, *this, src);
91}
92
93//
94// Stretches the DIB onto the destination DC.
95//
96bool
98 int srcX, int srcY, int srcW, int srcH) const
99{
100 return dstDC.StretchBlt(dstX, dstY, dstW, dstH, *this, srcX, srcY, srcW, srcH);
101}
102
103
104} // OWL namespace
105
#define DIAG_DECLARE_GROUP(group)
Definition checks.h:404
TBitmap is the GDI bitmap class derived from TGdiObject.
Definition gdiobjec.h:510
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
void SelectObject(const TBrush &brush)
Selects the given GDI brush object into this DC.
Definition dc.cpp:113
void CheckValid(uint resId=IDS_GDIFAILURE)
Definition gdibase.cpp:49
HDC GetHDC() const
Return the handle of the device context.
Definition dc.h:981
uint SetDIBColorTable(uint start, uint entries, const RGBQUAD *colors)
Definition dibdc.cpp:54
uint GetDIBColorTable(uint start, uint entries, RGBQUAD *colors)
Definition dibdc.cpp:45
bool BitBltToScreen(TDC &dstDC, const TRect &dst, const TPoint &src) const
Definition dibdc.cpp:69
bool StretchBltToScreen(TDC &dstDC, const TRect &dst, const TRect &src) const
Definition dibdc.cpp:88
A device context (DC) class derived from TCreatedDC, TMemoryDC provides access to a memory DC.
Definition dc.h:784
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
Definition of GDI DC encapsulation classes: TDC, TWindowDC, TScreenDC, TDesktopDC,...
Definition of abstract GDI object class and derived classes.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
OWL_DIAGINFO
Definition animctrl.cpp:14
unsigned int uint
Definition number.h:25