OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
dibitmap.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of DeviceIndependent Bitmap object class
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_DIBITMAP_H)
10#define OWL_DIBITMAP_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/gdiobjec.h>
18
19
20namespace owl {
21
22#include <owl/preclass.h>
23
24/// \addtogroup graphics
25/// @{
26/// \class TDiBitmap
27// ~~~~~ ~~~~~~~~~
28/// The TDiBitmap class is a combination of a TDib and a TBitmap. It can be
29/// constructed and manipulated like a TDib, but it can also be selected into
30/// a dc and manipulated with GDI. To guarantee functionality on all platforms,
31/// the TDibDC should be used as the memory dc to hold a TDiBitmap
32//
33class _OWLCLASS TDiBitmap : public TBitmap, public TDib {
34 public:
35 // Constructors and destructor
37 TDiBitmap(const TClipboard& clipboard);
38 TDiBitmap(const TDib& src);
39
40 TDiBitmap(int width, int height, int nColors, uint16 mode=DIB_RGB_COLORS);
44 TDiBitmap(TFile& file, bool readFileHeader = true);
45 TDiBitmap(std::istream& is, bool readFileHeader = false);
46 TDiBitmap(const TBitmap& bitmap, const TPalette* pal = 0);
47 ~TDiBitmap();
48
49 int Width() const;
50 int Height() const;
51 TSize Size() const;
52 int BitsPixel() const;
53
54 protected:
55 void InitBitmap();
56 //JJH - removed, because CheckValid wasn't defined
57 #if !defined(STRIP_UNDEFINED)
59 #endif
60
61 private:
62 // Prevent accidental copying of object
64 TDiBitmap(const TDiBitmap& src);
65 TDiBitmap();
66
67};
68
69//
70/// \class TIdentityPalette
71// ~~~~~ ~~~~~~~~~~~~~~~~
72/// An identity palette is a palette where the colors and order of those colors
73/// match the physical palette.
74/// Use the identity palette whenever possible, because if the system does not
75/// have to map colors, it can speed bitmap drawing.
76//
78 public:
80};
81
82//
83/// \class THalftonePalette
84// ~~~~~ ~~~~~~~~~~~~~~~~
85/// A halftone palette is intended for use when the stretching mode of a
86/// device context is set to HALFTONE.
87//
89 public:
91};
92/// @}
93
94#include <owl/posclass.h>
95
96//----------------------------------------------------------------------------
97// Inline implementations
98//
99
100//
101/// Return the width of the dib.
102//
103inline int
105{
106 return TDib::Width();
107}
108
109//
110/// Return the height of the dib.
111//
112inline int
114{
115 return TDib::Height();
116}
117
118//
119/// Return the size of the dib.
120//
121inline TSize
123{
124 return TDib::Size();
125}
126
127//
128/// Return number of bits to hold each pixel.
129//
130inline int
132{
133 return TDib::BitsPixel();
134}
135
136
137} // OWL namespace
138
139
140#endif // OWL_DIBITMAP_H
TBitmap is the GDI bitmap class derived from TGdiObject.
Definition gdiobjec.h:510
The clipboard class encapsulates the methods for the clipboard object of Windows.
Definition clipboar.h:32
The TDiBitmap class is a combination of a TDib and a TBitmap.
Definition dibitmap.h:33
int BitsPixel() const
Return number of bits to hold each pixel.
Definition dibitmap.h:131
TSize Size() const
Return the size of the dib.
Definition dibitmap.h:122
int Height() const
Return the height of the dib.
Definition dibitmap.h:113
void CheckValid(uint resId=IDS_GDIFAILURE)
int Width() const
Return the width of the dib.
Definition dibitmap.h:104
Pseudo-GDI object Device Independent Bitmap (DIB) class.
Definition gdiobjec.h:795
int BitsPixel() const
Return the number of bits (2, 4, 8, 16, 24, or 32) used to store a pixel for the DIB.
Definition gdiobjec.h:1873
int Width() const
Returns the width of the DIB.
Definition gdiobjec.h:1832
int Height() const
Returns the height of the DIB.
Definition gdiobjec.h:1840
TSize Size() const
Returns TSize(W,H), the size of this DIB.
Definition gdiobjec.h:1856
The TFile class encapsulates standard file characteristics and operations.
Definition file.h:120
A halftone palette is intended for use when the stretching mode of a device context is set to HALFTON...
Definition dibitmap.h:88
An identity palette is a palette where the colors and order of those colors match the physical palett...
Definition dibitmap.h:77
TPalette is the GDI Palette class derived from TGdiObject.
Definition gdiobjec.h:413
The tagSIZE struct is defined as.
Definition geometry.h:234
Definition of abstract GDI object class and derived classes.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Definition gdibase.h:70
@ NoAutoDelete
Definition gdibase.h:70
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
unsigned short uint16
Definition number.h:33
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define _OWLCLASS
Definition defs.h:338