OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
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
20
namespace
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
//
33
class
_OWLCLASS
TDiBitmap
:
public
TBitmap
,
public
TDib
{
34
public
:
35
// Constructors and destructor
36
TDiBitmap
(HGLOBAL handle,
TAutoDelete
autoDelete =
NoAutoDelete
);
37
TDiBitmap
(
const
TClipboard
& clipboard);
38
TDiBitmap
(
const
TDib
& src);
39
40
TDiBitmap
(
int
width,
int
height,
int
nColors,
uint16
mode=DIB_RGB_COLORS);
41
TDiBitmap
(HINSTANCE module,
TResId
resid);
42
TDiBitmap
(LPCTSTR filename);
43
TDiBitmap
(
const
tstring
& filename);
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)
58
void
CheckValid
(
uint
resId = IDS_GDIFAILURE);
59
#endif
60
61
private
:
62
// Prevent accidental copying of object
63
TDiBitmap
& operator =(
const
TDiBitmap
&);
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
//
77
class
_OWLCLASS
TIdentityPalette
:
public
TPalette
{
78
public
:
79
TIdentityPalette
(
const
TPalette
& palette);
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
//
88
class
_OWLCLASS
THalftonePalette
:
public
TPalette
{
89
public
:
90
THalftonePalette
();
91
};
92
/// @}
93
94
#include <
owl/posclass.h
>
95
96
//----------------------------------------------------------------------------
97
// Inline implementations
98
//
99
100
//
101
/// Return the width of the dib.
102
//
103
inline
int
104
TDiBitmap::Width
()
const
105
{
106
return
TDib::Width
();
107
}
108
109
//
110
/// Return the height of the dib.
111
//
112
inline
int
113
TDiBitmap::Height
()
const
114
{
115
return
TDib::Height
();
116
}
117
118
//
119
/// Return the size of the dib.
120
//
121
inline
TSize
122
TDiBitmap::Size
()
const
123
{
124
return
TDib::Size
();
125
}
126
127
//
128
/// Return number of bits to hold each pixel.
129
//
130
inline
int
131
TDiBitmap::BitsPixel
()
const
132
{
133
return
TDib::BitsPixel
();
134
}
135
136
137
}
// OWL namespace
138
139
140
#endif
// OWL_DIBITMAP_H
owl::TBitmap::TBitmap
TBitmap(HBITMAP handle, TAutoDelete autoDelete=NoAutoDelete)
Construct an alias TBitmap for an existing bitmap handle.
Definition
bitmap.cpp:33
owl::TClipboard
The clipboard class encapsulates the methods for the clipboard object of Windows.
Definition
clipboar.h:32
owl::TDiBitmap::InitBitmap
void InitBitmap()
Initializes our bitmap side from the DIB side.
Definition
dibitmap.cpp:27
owl::TDiBitmap::BitsPixel
int BitsPixel() const
Return number of bits to hold each pixel.
Definition
dibitmap.h:131
owl::TDiBitmap::Size
TSize Size() const
Return the size of the dib.
Definition
dibitmap.h:122
owl::TDiBitmap::Height
int Height() const
Return the height of the dib.
Definition
dibitmap.h:113
owl::TDiBitmap::CheckValid
void CheckValid(uint resId=IDS_GDIFAILURE)
owl::TDiBitmap::TDiBitmap
TDiBitmap(HGLOBAL handle, TAutoDelete autoDelete=NoAutoDelete)
Construct from existing bitmap handle.
Definition
dibitmap.cpp:59
owl::TDiBitmap::Width
int Width() const
Return the width of the dib.
Definition
dibitmap.h:104
owl::TDib::BitsPixel
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
owl::TDib::Width
int Width() const
Returns the width of the DIB.
Definition
gdiobjec.h:1832
owl::TDib::TDib
TDib(HGLOBAL handle, TAutoDelete autoDelete=NoAutoDelete)
Creates a TDib object and sets the Handle data member to the given borrowed handle.
Definition
dib.cpp:170
owl::TDib::Height
int Height() const
Returns the height of the DIB.
Definition
gdiobjec.h:1840
owl::TDib::Size
TSize Size() const
Returns TSize(W,H), the size of this DIB.
Definition
gdiobjec.h:1856
owl::TFile
The TFile class encapsulates standard file characteristics and operations.
Definition
file.h:120
owl::THalftonePalette::THalftonePalette
THalftonePalette()
Default constructor. Retrieves the system's halftone palette.
Definition
dibitmap.cpp:253
owl::TIdentityPalette::TIdentityPalette
TIdentityPalette(const TPalette &palette)
Implementation of Identity Palette object, TIdentityPalette.
Definition
dibitmap.cpp:180
owl::TPalette
TPalette is the GDI Palette class derived from TGdiObject.
Definition
gdiobjec.h:413
owl::TPalette::TPalette
TPalette(HPALETTE handle, TAutoDelete autoDelete=NoAutoDelete)
Alias an existing palette handle. Assume ownership if autoDelete says so.
Definition
palette.cpp:40
owl::TResId
Definition
wsyscls.h:206
owl::TSize
The tagSIZE struct is defined as.
Definition
geometry.h:234
gdiobjec.h
Definition of abstract GDI object class and derived classes.
owl::TAutoDelete
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Definition
gdibase.h:70
owl::NoAutoDelete
@ NoAutoDelete
Definition
gdibase.h:70
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::uint16
unsigned short uint16
Definition
number.h:33
owl::tstring
std::string tstring
Definition
defs.h:79
owl::uint
unsigned int uint
Definition
number.h:25
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
include
owl
dibitmap.h
Generated by
1.18.0