SavvyUI C++ UI Library
Loading...
Searching...
No Matches
ImageCache.h
Go to the documentation of this file.
1#pragma once
2
3#include "GraphicsContext.h"
4
13{
14 map<wstring, Gdiplus::Image*> _imageCache;
15
16public:
17
22
26 virtual ~ImageCache();
27
31 void clear();
32
40 BOOL addImage(const wstring& key, const wstring& filePath);
41
52 BOOL drawImage(Graphics *g, const wstring& key, Bounds rect, const ImageAlignment& alignment, BOOL showBorder);
53};
ImageAlignment
Definition Common.h:121
Definition Common.h:20
Definition Graphics.h:161
void clear()
Clears all cached images, releasing their memory.
BOOL drawImage(Graphics *g, const wstring &key, Bounds rect, const ImageAlignment &alignment, BOOL showBorder)
Draws a cached image identified by key onto a device context.
virtual ~ImageCache()
Destructor clears and releases all cached images.
BOOL addImage(const wstring &key, const wstring &filePath)
Loads an image from a file and adds it to the cache with the specified key.
ImageCache()
Constructs an empty ImageCache.