From 20fc422550ba522bc9b03b76baab1ed6a101a6f5 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 5 Feb 2021 23:53:28 +0100 Subject: [PATCH] Fix creating sub-bitmap of wxGraphicsBitmap (GDI+) Retrieved sub-bitmap should have the same pixel format like the source bitmap. --- src/msw/graphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index db4d63d2a5..cfb269b6c6 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -2869,7 +2869,7 @@ wxGraphicsBitmap wxGDIPlusRenderer::CreateSubBitmap( const wxGraphicsBitmap &bit wxNullGraphicsBitmap, wxS("Invalid bitmap region")); wxGraphicsBitmap p; - p.SetRefData(new wxGDIPlusBitmapData( this , image->Clone( (REAL) x , (REAL) y , (REAL) w , (REAL) h , PixelFormat32bppPARGB) )); + p.SetRefData(new wxGDIPlusBitmapData( this , image->Clone( (REAL) x , (REAL) y , (REAL) w , (REAL) h , image->GetPixelFormat()) )); return p; } else