SavvyUI C++ UI Library
Loading...
Searching...
No Matches
Image.h
Go to the documentation of this file.
1#pragma once
2
3#include "Component.h"
4
11class Image : public Component
12{
13 BOOL _imageIsResourceID;
14 int _imageResourceID;
15 ImageType _imageType;
16 wstring _imageFile;
17 ImageAlignment _alignment;
21
22protected:
32 BOOL getCreateWindowOptions(wstring& title, UINT& widownStyles, wstring& wndClassName, BOOL& isCustomWndProc);
33
38
39public:
41 virtual ~Image();
42
48 void setImage(const wstring& imageFile);
49 void setImage(int resourceID, const ImageType& imageType);
50
59 void setAlignment(const ImageAlignment& alignment);
60
66 void onPaint(Graphics *g);
67};
ImageType
Definition Common.h:133
ImageAlignment
Definition Common.h:121
Component()
Constructs a new Component instance.
Definition Graphics.h:161
void setImage(int resourceID, const ImageType &imageType)
void windowCreated()
Called when the native window has been created; used for initialization.
void setAlignment(const ImageAlignment &alignment)
Sets the alignment of the image within the component.
void setImage(const wstring &imageFile)
Sets the image file to display.
virtual ~Image()
BOOL getCreateWindowOptions(wstring &title, UINT &widownStyles, wstring &wndClassName, BOOL &isCustomWndProc)
Provides options required to create the native window for the image component.
void onPaint(Graphics *g)
Paints the image inside the component, respecting the alignment.