45 virtual void Create(
const HWND& _hwnd,
const uint32_t& _xres,
const uint32_t& _yres);
56 bool ResizeBitmap(
const uint32_t& _xres,
const uint32_t& _yres);
64 virtual bool Resize(
const uint32_t& _xres,
const uint32_t& _yres);
67 D2D1_SIZE_F
GetSize(
void)
const {
return render_target->GetSize(); }
ID2D1SolidColorBrush * text_brush
Direct2D brush for text (do not use a unique_ptr for COM interfaces)
virtual bool Resize(const uint32_t &_xres, const uint32_t &_yres)
Resizes the render target.
~D2ChannelRender()
Discard resources and delete the render_target.
virtual void UpdateScaleText(const std::wstring &_text)
Update the scale text.
D2D1_SIZE_F GetSize(void) const
std::shared_ptr< D2ChannelRender > D2ChannelRenderPtr
Shared pointer to a D2ChannelRender.
void DrawBitmap()
Draws current bitmap in render target.
Wrappers around the Direct2D interface.
Handles all Direct2D rendering in a CChannelView.
Parts of the code are modified from Microsoft's Direct2D nbody example: Copyright (c) Microsoft Corpo...
void DiscardDeviceResources()
Safely release all Direct2D resources.
virtual void Render()
Renders the bitmap and the scale text.
ID2D1Bitmap * Bitmap() const
IDWriteTextFormat * text_format
Direct2D text format (do not use a unique_ptr for COM interfaces)
std::unique_ptr< RenderTarget > render_target
Direct2D render target.
std::mutex mutex
mutex for protection
ID2D1Bitmap * bitmap
Direct2D bitmap (do not use a unique_ptr for COM interfaces)
bool ResizeBitmap(const uint32_t &_xres, const uint32_t &_yres)
Resizes the bitmap.
virtual void Create(const HWND &_hwnd, const uint32_t &_xres, const uint32_t &_yres)
Creates the render target for a hwnd, a bitmap with the desired resolution, a brushes for painting ...
std::wstring scaletext
String with the scale information, ala L"9.5 µm".