mirror of
				https://github.com/chibicitiberiu/rainmeter-studio.git
				synced 2024-02-24 04:33:31 +00:00 
			
		
		
		
	Prepare canvas for rendering to bitmap only
This commit is contained in:
		@@ -69,6 +69,7 @@ public:
 | 
			
		||||
	// matched by a corresponding call to ReleaseDC(). While in the Gdiplus context, non-const
 | 
			
		||||
	// member functions of this class must not be called.
 | 
			
		||||
	virtual HDC GetDC() = 0;
 | 
			
		||||
	virtual HBITMAP GetBitmap() = 0;
 | 
			
		||||
	virtual void ReleaseDC(HDC dc) = 0;
 | 
			
		||||
 | 
			
		||||
	// The Create* functions allocate objects specific to this Canvas object.
 | 
			
		||||
 
 | 
			
		||||
@@ -210,6 +210,13 @@ HDC CanvasD2D::GetDC()
 | 
			
		||||
	return dcMemory;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
HBITMAP CanvasD2D::GetBitmap()
 | 
			
		||||
{
 | 
			
		||||
	EndTargetDraw();
 | 
			
		||||
 | 
			
		||||
	return m_Bitmap.GetHandle();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CanvasD2D::ReleaseDC(HDC dc)
 | 
			
		||||
{
 | 
			
		||||
	DeleteDC(dc);
 | 
			
		||||
 
 | 
			
		||||
@@ -51,6 +51,7 @@ public:
 | 
			
		||||
	virtual void EndGdiplusContext() override;
 | 
			
		||||
 | 
			
		||||
	virtual HDC GetDC() override;
 | 
			
		||||
	virtual HBITMAP GetBitmap() override;
 | 
			
		||||
	virtual void ReleaseDC(HDC dc) override;
 | 
			
		||||
	
 | 
			
		||||
	virtual FontCollection* CreateFontCollection() override { return new FontCollectionD2D(); }
 | 
			
		||||
 
 | 
			
		||||
@@ -99,6 +99,12 @@ HDC CanvasGDIP::GetDC()
 | 
			
		||||
	return dcMemory;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
HBITMAP CanvasGDIP::GetBitmap()
 | 
			
		||||
{
 | 
			
		||||
	return m_DIBSection;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void CanvasGDIP::ReleaseDC(HDC dc)
 | 
			
		||||
{
 | 
			
		||||
	DeleteDC(dc);
 | 
			
		||||
 
 | 
			
		||||
@@ -42,6 +42,7 @@ public:
 | 
			
		||||
	virtual void EndGdiplusContext() override;
 | 
			
		||||
 | 
			
		||||
	virtual HDC GetDC() override;
 | 
			
		||||
	virtual HBITMAP GetBitmap() override;
 | 
			
		||||
	virtual void ReleaseDC(HDC dc) override;
 | 
			
		||||
 | 
			
		||||
	virtual FontCollection* CreateFontCollection() override { return new FontCollectionGDIP(); }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user