Scope
|
#include <D2ChannelRender.h>
Public Member Functions | |
~D2ChannelRender () | |
virtual void | Create (const HWND &_hwnd, const uint32_t &_xres, const uint32_t &_yres) |
virtual void | Render () |
ID2D1Bitmap * | Bitmap () const |
bool | ResizeBitmap (const uint32_t &_xres, const uint32_t &_yres) |
void | DrawBitmap () |
virtual bool | Resize (const uint32_t &_xres, const uint32_t &_yres) |
D2D1_SIZE_F | GetSize (void) const |
virtual void | UpdateScaleText (const std::wstring &_text) |
Protected Member Functions | |
void | DiscardDeviceResources () |
Protected Attributes | |
std::mutex | mutex |
std::unique_ptr< RenderTarget > | render_target |
ID2D1Bitmap * | bitmap |
ID2D1SolidColorBrush * | text_brush |
IDWriteTextFormat * | text_format |
HWND | hwnd |
std::wstring | scaletext |
Handles all Direct2D rendering in a CChannelView.
Renders and resizes a bitmap. All mutex protected.
Definition at line 9 of file D2ChannelRender.h.
d2d::D2ChannelRender::~D2ChannelRender | ( | ) |
Discard resources and delete the render_target.
Definition at line 16 of file D2ChannelRender.cpp.
|
protected |
Safely release all Direct2D resources.
Definition at line 20 of file D2ChannelRender.cpp.
|
virtual |
Creates the render target for a hwnd, a bitmap with the desired resolution, a brushes for painting , and a text format for µm text.
Definition at line 26 of file D2ChannelRender.cpp.
|
virtual |
Renders the bitmap and the scale text.
Definition at line 49 of file D2ChannelRender.cpp.
|
inline |
Definition at line 51 of file D2ChannelRender.h.
bool d2d::D2ChannelRender::ResizeBitmap | ( | const uint32_t & | _xres, |
const uint32_t & | _yres | ||
) |
Resizes the bitmap.
[in] | _xres,_yres | new size |
Definition at line 42 of file D2ChannelRender.cpp.
|
inline |
Draws current bitmap in render target.
Definition at line 59 of file D2ChannelRender.h.
|
virtual |
Resizes the render target.
[in] | _xres,_yres | new size |
Definition at line 36 of file D2ChannelRender.cpp.
|
inline |
Definition at line 67 of file D2ChannelRender.h.
|
virtual |
Update the scale text.
Definition at line 73 of file D2ChannelRender.cpp.
|
mutableprotected |
mutex for protection
Definition at line 13 of file D2ChannelRender.h.
|
protected |
Direct2D render target.
Definition at line 16 of file D2ChannelRender.h.
|
protected |
Direct2D bitmap (do not use a unique_ptr for COM interfaces)
Definition at line 19 of file D2ChannelRender.h.
|
protected |
Direct2D brush for text (do not use a unique_ptr for COM interfaces)
Definition at line 22 of file D2ChannelRender.h.
|
protected |
Direct2D text format (do not use a unique_ptr for COM interfaces)
Definition at line 25 of file D2ChannelRender.h.
|
protected |
Window handle.
Definition at line 28 of file D2ChannelRender.h.
|
protected |
String with the scale information, ala L"9.5 µm".
Definition at line 31 of file D2ChannelRender.h.