mirror of
				https://github.com/chibicitiberiu/rainmeter-studio.git
				synced 2024-02-24 04:33:31 +00:00 
			
		
		
		
	Gfx: Use GDI+ instead of D2D when drawing scaled images
This commit is contained in:
		@@ -409,6 +409,14 @@ bool CanvasD2D::MeasureTextLinesW(const WCHAR* str, UINT strLen, const TextForma
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void CanvasD2D::DrawBitmap(Gdiplus::Bitmap* bitmap, const Gdiplus::Rect& dstRect, const Gdiplus::Rect& srcRect)
 | 
					void CanvasD2D::DrawBitmap(Gdiplus::Bitmap* bitmap, const Gdiplus::Rect& dstRect, const Gdiplus::Rect& srcRect)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						if (srcRect.Width != dstRect.Width || srcRect.Height != dstRect.Height)
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							// If the bitmap needs to be scaled, get rid of the D2D target and use the GDI+ code path
 | 
				
			||||||
 | 
							// to draw the bitmap. This is due to antialiasing differences between GDI+ and D2D on
 | 
				
			||||||
 | 
							// scaled bitmaps.
 | 
				
			||||||
 | 
							EndTargetDraw();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!m_Target)  // Use GDI+ if D2D render target has not been created.
 | 
						if (!m_Target)  // Use GDI+ if D2D render target has not been created.
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		m_GdipGraphics->DrawImage(
 | 
							m_GdipGraphics->DrawImage(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user