31 Attr.W = dib->
Width();
47 :
TWindow(parent, title, module),
55 Attr.W = dib->
Width();
106 if (HowToDisplay ==
Center) {
109 int offsetX = abs(dib->
Width() - clientRect.
Width()) / 2;
111 sourcePoint.x += offsetX;
113 clientRect.
Offset(offsetX, 0);
115 int offsetY = abs(dib->
Height() - clientRect.
Height()) / 2;
117 sourcePoint.y += offsetY;
119 clientRect.
Offset(0, offsetY);
125 clientRect.bottom = clientRect.top + dib->
Height();
126 clientRect.right = clientRect.left + dib->
Width();
131 clientRect.top -= sourcePoint.y;
132 clientRect.left -= sourcePoint.x;
137 switch (HowToDisplay) {
186 wndClass.style |= CS_HREDRAW | CS_VREDRAW;
TDC is the root class for GDI DC wrappers.
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 SetDIBitsToDevice(const TRect &dst, const TPoint &src, uint startScan, uint numScans, const void *bits, const BITMAPINFO &bitsInfo, uint16 usage)
The first version sets the pixels in dst (the given destination rectangle on this DC) from the source...
void RestoreObjects()
Restores all the original GDI objects to this DC.
int RealizePalette()
Maps to the system palette the logical palette entries selected into this DC.
int StretchDIBits(const TRect &dst, const TRect &src, const void *bits, const BITMAPINFO &bitsInfo, uint16 usage, uint32 rop=SRCCOPY)
Copies the color data from src, the source rectangle of pixels in the given DIB (device-independent b...
Pseudo-GDI object Device Independent Bitmap (DIB) class.
int Width() const
Returns the width of the DIB.
int Height() const
Returns the height of the DIB.
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
TPalette(HPALETTE handle, TAutoDelete autoDelete=NoAutoDelete)
Alias an existing palette handle. Assume ownership if autoDelete says so.
TDisplayHow GetHowToDisplay() const
~TPictureWindow()
Destructor for this class. Deletes the owned DIB.
virtual auto GetWindowClassName() -> TWindowClassName
Overridden from TWindow.
void GetWindowClass(WNDCLASS &wndClass)
Overridden from TWindow.
TDib * SetDib(TDib *newDib)
Allows changing of the DIB. Returns the old DIB.
TDisplayHow
How to display the bitmap within the window.
@ Stretch
Stretch to fit or shrink to fit.
@ UpperLeft
Displays the DIB in the upper left corner of the window.
TPictureWindow(TWindow *parent, TDib *dib, TDisplayHow=UpperLeft, LPCTSTR title=0, TModule *module=0)
Constructor for this class. Assumes ownership of the DIB passed in.
void SetHowToDisplay(TDisplayHow how)
Changes the formatting of the DIB.
void Paint(TDC &dc, bool erase, TRect &rect)
Paints the DIB onto the window.
TPoint is a support class, derived from tagPOINT.
Smart pointer to a single object. Provides member access operator ->.
TRect is a mathematical class derived from tagRect.
int Height() const
Returns the height of this rectangle (bottom - top).
TRect & Offset(int dx, int dy)
Changes this rectangle so its corners are offset by the given delta values.
int Width() const
Returns the width of this rectangle (right - left).
Type-safe encapsulation of a Windows class name, a union between ATOM and LPCTSTR.
TWindow(TWindow *parent, LPCTSTR title=nullptr, TModule *module=nullptr)
Adds this to the child list of parent if nonzero, and calls EnableAutoCreate so that this will be cre...
virtual void GetWindowClass(WNDCLASS &wndClass)
Redefined by derived classes, GetWindowClass fills the supplied MS-Windows registration class structu...
bool IsWindow() const
Returns true if an HWND is being used.
void GetClientRect(TRect &rect) const
Gets the coordinates of the window's client area and then copies them into the object referred to by ...
virtual void Invalidate(bool erase=true)
Invalidates (mark for painting) the entire client area of a window.
Definition of abstract GDI object class and derived classes.
Object Windows Library (OWLNext Core).
Definition of class TPictureWindow.
Various types of smart pointer templatized classes.
Definition of TSystem, a system information provider class.
Base window class TWindow definition, including HWND encapsulation.