canvas/qa/cppunit/canvastest.cxx                             |    4 -
 canvas/source/vcl/canvashelper.cxx                           |    2 
 drawinglayer/qa/unit/vclmetafileprocessor2d.cxx              |    4 -
 drawinglayer/qa/unit/vclpixelprocessor2d.cxx                 |    4 -
 drawinglayer/source/primitive2d/glowprimitive2d.cxx          |    2 
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx |    2 
 drawinglayer/source/primitive2d/shadowprimitive2d.cxx        |    2 
 drawinglayer/source/primitive2d/softedgeprimitive2d.cxx      |    2 
 emfio/source/reader/emfreader.cxx                            |    2 
 filter/source/msfilter/mstoolbar.cxx                         |    6 +-
 filter/source/svg/svgwriter.cxx                              |    2 
 include/vcl/graph.hxx                                        |    7 +-
 oox/source/drawingml/fillproperties.cxx                      |    2 
 sc/source/filter/excel/xiescher.cxx                          |    2 
 sd/source/filter/grf/sdgrffilter.cxx                         |    2 
 sd/source/ui/dlg/vectdlg.cxx                                 |    2 
 sd/source/ui/view/sdview3.cxx                                |    6 +-
 svtools/qa/unit/GraphicObjectTest.cxx                        |    4 -
 svx/qa/unit/XTableImportExportTest.cxx                       |    3 -
 svx/source/dialog/_bmpmask.cxx                               |   14 ++---
 svx/source/dialog/_contdlg.cxx                               |    4 -
 svx/source/svdraw/svdfmtf.cxx                                |   26 +++++------
 svx/source/svdraw/svdpdf.cxx                                 |    2 
 svx/source/xoutdev/_xoutbmp.cxx                              |    2 
 sw/source/core/doc/notxtfrm.cxx                              |    2 
 sw/source/core/layout/paintfrm.cxx                           |    4 -
 vcl/qa/api/XGraphicTest.cxx                                  |    4 -
 vcl/qa/cppunit/BackendTest.cxx                               |   12 ++---
 vcl/qa/cppunit/BitmapFilterTest.cxx                          |    4 -
 vcl/qa/cppunit/BitmapScaleTest.cxx                           |   16 +++---
 vcl/qa/cppunit/GraphicDescriptorTest.cxx                     |    8 +--
 vcl/qa/cppunit/GraphicMemoryTest.cxx                         |   10 ++--
 vcl/qa/cppunit/GraphicTest.cxx                               |   14 ++---
 vcl/qa/cppunit/cjktext.cxx                                   |    6 +-
 vcl/qa/cppunit/graphicfilter/filters-test.cxx                |    2 
 vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx           |    2 
 vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx           |    3 -
 vcl/qa/cppunit/png/PngFilterTest.cxx                         |   15 ++----
 vcl/qa/cppunit/svm/svmtest.cxx                               |   10 ++--
 vcl/qa/cppunit/text.cxx                                      |    6 +-
 vcl/source/bitmap/BitmapEx.cxx                               |    2 
 vcl/source/filter/itiff/itiff.cxx                            |    2 
 vcl/source/gdi/graph.cxx                                     |   17 ++-----
 vcl/source/graphic/UnoGraphic.cxx                            |    2 
 44 files changed, 120 insertions(+), 129 deletions(-)

New commits:
commit e28b04775a87b56737e9bd0c2731a94eff8f1476
Author:     Noel Grandin <[email protected]>
AuthorDate: Thu Aug 28 13:09:19 2025 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Thu Aug 28 15:08:06 2025 +0200

    BitmapEx->Bitmap in Graphic
    
    now that Bitmap can handle transparency.
    
    This just removes the Graphic(BitmapEx) constructor and pushes
    the conversion from BitmapEx->Bitmap out to the call sites.
    
    Change-Id: I5d8b9838365458524185d3cfffe4a8f05d40d0ef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190324
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/canvas/qa/cppunit/canvastest.cxx b/canvas/qa/cppunit/canvastest.cxx
index b66a1ad1552c..cfe8961379fb 100644
--- a/canvas/qa/cppunit/canvastest.cxx
+++ b/canvas/qa/cppunit/canvastest.cxx
@@ -41,9 +41,9 @@ class CanvasTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
+            Bitmap aBitmap(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             SvFileStream aStream(filename, StreamMode::WRITE | 
StreamMode::TRUNC);
-            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
+            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream);
         }
     }
 
diff --git a/canvas/source/vcl/canvashelper.cxx 
b/canvas/source/vcl/canvashelper.cxx
index 8da6a0a4d7f9..e2e7f28755ea 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -842,7 +842,7 @@ namespace vclcanvas
                         AlphaMask aAlpha( aBmp.CreateAlphaMask() );
                         aAlpha.Invert();
                         BitmapEx a2ndBmpEx( aBmp.CreateColorBitmap(), aAlpha );
-                        p2ndGrfObj = std::make_shared<GraphicObject>( 
a2ndBmpEx );
+                        p2ndGrfObj = std::make_shared<GraphicObject>( 
Bitmap(a2ndBmpEx) );
                     }
 
                     p2ndGrfObj->Draw(mp2ndOutDevProvider->getOutDev(),
diff --git a/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx 
b/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
index 3fa4cc335f68..7845e1623693 100644
--- a/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/qa/unit/vclmetafileprocessor2d.cxx
@@ -40,9 +40,9 @@ class VclMetaFileProcessor2DTest : public 
test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
+            Bitmap aBitmap(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             SvFileStream aStream(filename, StreamMode::WRITE | 
StreamMode::TRUNC);
-            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
+            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream);
         }
     }
 
diff --git a/drawinglayer/qa/unit/vclpixelprocessor2d.cxx 
b/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
index 8c995a4f92ba..bdb46ffeb5af 100644
--- a/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
+++ b/drawinglayer/qa/unit/vclpixelprocessor2d.cxx
@@ -34,9 +34,9 @@ class VclPixelProcessor2DTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
+            Bitmap aBitmap(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             SvFileStream aStream(filename, StreamMode::WRITE | 
StreamMode::TRUNC);
-            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
+            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream);
         }
     }
 
diff --git a/drawinglayer/source/primitive2d/glowprimitive2d.cxx 
b/drawinglayer/source/primitive2d/glowprimitive2d.cxx
index 6dfe352c9cff..d1e094017cef 100644
--- a/drawinglayer/source/primitive2d/glowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/glowprimitive2d.cxx
@@ -229,7 +229,7 @@ void GlowPrimitive2D::create2DDecomposition(
         {
             SvFileStream aNew(sDumpPath + "test_glow.png", StreamMode::WRITE | 
StreamMode::TRUNC);
             vcl::PngImageWriter aPNGWriter(aNew);
-            aPNGWriter.write(result);
+            aPNGWriter.write(Bitmap(result));
         }
     }
 #endif
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx 
b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index ba44885c3160..17db841a7f77 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -209,7 +209,7 @@ namespace drawinglayer::primitive2d
                 {
                     // need to create FillGraphicPrimitive2D
                     const drawinglayer::attribute::FillGraphicAttribute 
aAttribute(
-                        Graphic(bitmap),
+                        Graphic(Bitmap(bitmap)),
                         maFillGraphicAttribute.getGraphicRange(),
                         maFillGraphicAttribute.getTiling(),
                         maFillGraphicAttribute.getOffsetX(),
diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx 
b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
index 4c8726a25b9f..5a0c06d141f8 100644
--- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -266,7 +266,7 @@ void ShadowPrimitive2D::create2DDecomposition(
             SvFileStream aNew(sDumpPath + "test_shadowblur.png",
                               StreamMode::WRITE | StreamMode::TRUNC);
             vcl::PngImageWriter aPNGWriter(aNew);
-            aPNGWriter.write(result);
+            aPNGWriter.write(Bitmap(result));
         }
     }
 #endif
diff --git a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx 
b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
index 6f21715168d9..b652435c8922 100644
--- a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx
@@ -225,7 +225,7 @@ void SoftEdgePrimitive2D::create2DDecomposition(
                 SvFileStream aNew(sDumpPath + "test_softedge.png",
                                   StreamMode::WRITE | StreamMode::TRUNC);
                 vcl::PngImageWriter aPNGWriter(aNew);
-                aPNGWriter.write(result);
+                aPNGWriter.write(Bitmap(result));
             }
         }
 #endif
diff --git a/emfio/source/reader/emfreader.cxx 
b/emfio/source/reader/emfreader.cxx
index 9c5c3fa0ab54..af552ccca946 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1655,7 +1655,7 @@ namespace emfio
                                             SvFileStream aNew(sDumpPath + 
"metafile_content.png",
                                                             StreamMode::WRITE 
| StreamMode::TRUNC);
                                             vcl::PngImageWriter 
aPNGWriter(aNew);
-                                            aPNGWriter.write(aBitmapEx);
+                                            
aPNGWriter.write(Bitmap(aBitmapEx));
                                         }
                                     }
 #endif
diff --git a/filter/source/msfilter/mstoolbar.cxx 
b/filter/source/msfilter/mstoolbar.cxx
index 47906a944777..da405567dca2 100644
--- a/filter/source/msfilter/mstoolbar.cxx
+++ b/filter/source/msfilter/mstoolbar.cxx
@@ -292,7 +292,7 @@ void TBCData::ImportToolBarControl( 
CustomToolBarImportHelper& helper, std::vect
                 // Without a command openoffice won't display the icon
                 if ( !sCommand.isEmpty() )
                 {
-                    BitmapEx aBitEx( pIcon->getBitMap() );
+                    Bitmap aBit( pIcon->getBitMap() );
                     TBCBitMap* pIconMask = pSpecificInfo->getIconMask();
                     if (pIconMask)
                     {
@@ -303,11 +303,11 @@ void TBCData::ImportToolBarControl( 
CustomToolBarImportHelper& helper, std::vect
                             // according to the spec:
                             // "the iconMask is white in all the areas in 
which the icon is
                             // displayed as transparent and is black in all 
other areas."
-                            aBitEx = BitmapEx(aBitEx.GetBitmap(), 
rMaskBase.CreateAlphaMask(COL_WHITE));
+                            aBit = Bitmap(BitmapEx(aBit.CreateColorBitmap(), 
rMaskBase.CreateAlphaMask(COL_WHITE)));
                         }
                     }
 
-                    Graphic aGraphic( aBitEx );
+                    Graphic aGraphic( aBit );
                     helper.addIcon( aGraphic.GetXGraphic(), sCommand );
                 }
             }
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 81cf70644548..dc0436422f0e 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -3018,7 +3018,7 @@ void SVGActionWriter::ImplWriteBmp( const BitmapEx& 
rBmpEx,
         }
     }
 
-    if( !(bCached || GraphicConverter::Export( aOStm, *pBitmap, 
ConvertDataFormat::PNG ) == ERRCODE_NONE) )
+    if( !(bCached || GraphicConverter::Export( aOStm, Bitmap(*pBitmap), 
ConvertDataFormat::PNG ) == ERRCODE_NONE) )
         return;
 
     Point                    aPt;
diff --git a/include/vcl/graph.hxx b/include/vcl/graph.hxx
index 722a05677517..e1875cd8fd90 100644
--- a/include/vcl/graph.hxx
+++ b/include/vcl/graph.hxx
@@ -23,7 +23,7 @@
 #include <vcl/dllapi.h>
 #include <tools/solar.h>
 #include <rtl/ustring.hxx>
-#include <vcl/bitmapex.hxx>
+#include <vcl/bitmap.hxx>
 #include <vcl/animate/Animation.hxx>
 #include <vcl/gfxlink.hxx>
 #include <com/sun/star/uno/Reference.hxx>
@@ -92,7 +92,6 @@ public:
                     Graphic( const Graphic& rGraphic );
                     Graphic( Graphic&& rGraphic ) noexcept;
                     Graphic( const Image& rImage );
-                    Graphic( const BitmapEx& rBmpEx );
                     Graphic( const Bitmap& rBmp );
                     Graphic( const std::shared_ptr<VectorGraphicData>& 
rVectorGraphicDataPtr );
                     Graphic( const Animation& rAnimation );
@@ -126,7 +125,7 @@ public:
     // MetaFile when played. Defaults will use a no-AAed, not snapped 
conversion as
     // before.
     Bitmap          GetBitmap(const GraphicConversionParameters& rParameters = 
GraphicConversionParameters()) const;
-    /// Gives direct access to the contained BitmapEx.
+    /// Gives direct access to the contained Bitmap.
     const Bitmap&   GetBitmapRef() const;
 
     Animation       GetAnimation() const;
@@ -152,7 +151,7 @@ public:
     void            Draw(OutputDevice& rOutDev, const Point& rDestPt,
                          const Size& rDestSize) const;
     static void     DrawEx(OutputDevice& rOutDev, const OUString& rText,
-                           vcl::Font& rFont, const BitmapEx& rBitmap,
+                           vcl::Font& rFont, const Bitmap& rBitmap,
                            const Point& rDestPt, const Size& rDestSize);
 
     void            StartAnimation(OutputDevice& rOutDev,
diff --git a/oox/source/drawingml/fillproperties.cxx 
b/oox/source/drawingml/fillproperties.cxx
index 20c2f9cd29fc..27e2f14e042c 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -215,7 +215,7 @@ Reference<XGraphic> lclApplyBlackWhiteEffect(const 
BlipFillProperties& aBlipProp
             Bitmap aTmpBmp(aBitmap.CreateColorBitmap());
             BitmapFilter::Filter(aTmpBmp, BitmapMonochromeFilter{ nThreshold 
});
 
-            aReturnGraphic = ::Graphic(BitmapEx(aTmpBmp, aMask));
+            aReturnGraphic = ::Graphic(Bitmap(BitmapEx(aTmpBmp, aMask)));
         }
         else
         {
diff --git a/sc/source/filter/excel/xiescher.cxx 
b/sc/source/filter/excel/xiescher.cxx
index b4bcf61451e2..2796c6f9a006 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -760,7 +760,7 @@ void XclImpDrawObjBase::ConvertFillStyle( SdrObject& 
rSdrObj, const XclObjFillDa
             aBitmap = aXOBitmap.GetBitmap();
 
             rSdrObj.SetMergedItem(XFillStyleItem(drawing::FillStyle_BITMAP));
-            rSdrObj.SetMergedItem(XFillBitmapItem(OUString(), 
Graphic(BitmapEx(aBitmap))));
+            rSdrObj.SetMergedItem(XFillBitmapItem(OUString(), 
Graphic(aBitmap)));
         }
     }
 }
diff --git a/sd/source/filter/grf/sdgrffilter.cxx 
b/sd/source/filter/grf/sdgrffilter.cxx
index ad544150da93..26469e5dc7bc 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -167,7 +167,7 @@ bool SdGRFFilter::Import()
             }
             for (size_t nPageIndex = 0; nPageIndex < nImages; ++nPageIndex)
             {
-                InsertSdrGrafObj(aAnim.Get(nPageIndex).maBitmapEx,
+                InsertSdrGrafObj(Bitmap(aAnim.Get(nPageIndex).maBitmapEx),
                                  mrDocument.GetSdPage(nPageIndex, 
PageKind::Standard));
             }
         }
diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx
index 7765613a15a7..2946f934c274 100644
--- a/sd/source/ui/dlg/vectdlg.cxx
+++ b/sd/source/ui/dlg/vectdlg.cxx
@@ -103,7 +103,7 @@ void SdVectorizeDlg::InitPreviewBmp()
 
     aPreviewBmp = aBmp;
     aPreviewBmp.Scale( aRect.GetSize() );
-    m_aBmpWin.SetGraphic(BitmapEx(aPreviewBmp));
+    m_aBmpWin.SetGraphic(aPreviewBmp);
 }
 
 Bitmap SdVectorizeDlg::GetPreparedBitmap( Bitmap const & rBmp, Fraction& 
rScale )
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index c655c0acfa8d..5f4f6f5abc9c 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -200,7 +200,7 @@ bool View::InsertMetaFile( const TransferableDataHelper& 
rDataHelper, const Poin
                             {
                                 MetaBmpAction* pBmpAction = dynamic_cast< 
MetaBmpAction* >( pAction );
                                 if( pBmpAction )
-                                    aGraphic = 
Graphic(BitmapEx(pBmpAction->GetBitmap()));
+                                    aGraphic = 
Graphic(pBmpAction->GetBitmap());
                             }
                             break;
                         case MetaActionType::BMPSCALE:
@@ -214,14 +214,14 @@ bool View::InsertMetaFile( const TransferableDataHelper& 
rDataHelper, const Poin
                             {
                                 MetaBmpExAction* pBmpExAction = dynamic_cast< 
MetaBmpExAction* >( pAction );
                                 if( pBmpExAction )
-                                    aGraphic = 
Graphic(pBmpExAction->GetBitmapEx() );
+                                    aGraphic = 
Graphic(Bitmap(pBmpExAction->GetBitmapEx()) );
                             }
                             break;
                         case MetaActionType::BMPEXSCALE:
                             {
                                 MetaBmpExScaleAction* pBmpExScaleAction = 
dynamic_cast< MetaBmpExScaleAction* >( pAction );
                                 if( pBmpExScaleAction )
-                                    aGraphic = Graphic( 
pBmpExScaleAction->GetBitmapEx() );
+                                    aGraphic = Graphic( 
Bitmap(pBmpExScaleAction->GetBitmapEx()) );
                             }
                             break;
                         default: break;
diff --git a/svtools/qa/unit/GraphicObjectTest.cxx 
b/svtools/qa/unit/GraphicObjectTest.cxx
index 766baea6b1cb..ba8df8e842ec 100644
--- a/svtools/qa/unit/GraphicObjectTest.cxx
+++ b/svtools/qa/unit/GraphicObjectTest.cxx
@@ -43,9 +43,9 @@ private:
 void GraphicObjectTest::testTdf88836()
 {
     // Construction with empty bitmap -> type should be GraphicType::NONE
-    Graphic aGraphic = BitmapEx(Bitmap());
+    Graphic aGraphic = Bitmap();
     CPPUNIT_ASSERT_EQUAL(int(GraphicType::NONE), int(aGraphic.GetType()));
-    aGraphic = Graphic(BitmapEx());
+    aGraphic = Graphic(Bitmap());
     CPPUNIT_ASSERT_EQUAL(int(GraphicType::NONE), int(aGraphic.GetType()));
 }
 
diff --git a/svx/qa/unit/XTableImportExportTest.cxx 
b/svx/qa/unit/XTableImportExportTest.cxx
index 5cad8efbb9cd..f380ee48d481 100644
--- a/svx/qa/unit/XTableImportExportTest.cxx
+++ b/svx/qa/unit/XTableImportExportTest.cxx
@@ -47,8 +47,7 @@ CPPUNIT_TEST_FIXTURE(XTableImportExportTest, testImportExport)
 
         Bitmap aBitmap(Size(5, 5), vcl::PixelFormat::N24_BPP);
         aBitmap.Erase(COL_RED);
-        BitmapEx aBitmapEx(aBitmap);
-        Graphic aGraphic(aBitmapEx);
+        Graphic aGraphic(aBitmap);
         uno::Reference<awt::XBitmap> xBitmap(aGraphic.GetXGraphic(), 
css::uno::UNO_QUERY);
 
         xNameContainer->insertByName(u"SomeBitmap"_ustr, uno::Any(xBitmap));
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index ce33363d6879..fc71042fd3a6 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -635,7 +635,7 @@ Animation SvxBmpMask::ImpMask( const Animation& rAnimation )
     for( sal_uInt16 i = 0; i < nAnimationCount; i++ )
     {
         AnimationFrame aAnimationFrame( aAnimation.Get( i ) );
-        aAnimationFrame.maBitmapEx = 
BitmapEx(Mask(aAnimationFrame.maBitmapEx).GetBitmap());
+        aAnimationFrame.maBitmapEx = 
BitmapEx(Mask(Bitmap(aAnimationFrame.maBitmapEx)).GetBitmap());
         aAnimation.Replace(aAnimationFrame, i);
     }
 
@@ -810,7 +810,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMP:
                 {
                     MetaBmpAction*  pAct = 
static_cast<MetaBmpAction*>(pAction);
-                    const Bitmap    aBmp( 
Mask(BitmapEx(pAct->GetBitmap())).GetBitmap().CreateColorBitmap() );
+                    const Bitmap    aBmp( 
Mask(pAct->GetBitmap()).GetBitmap().CreateColorBitmap() );
 
                     pAct = new MetaBmpAction( pAct->GetPoint(), aBmp );
                     aMtf.AddAction( pAct );
@@ -820,7 +820,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMPSCALE:
                 {
                     MetaBmpScaleAction* pAct = 
static_cast<MetaBmpScaleAction*>(pAction);
-                    const Bitmap        aBmp( 
Mask(BitmapEx(pAct->GetBitmap())).GetBitmap().CreateColorBitmap() );
+                    const Bitmap        aBmp( 
Mask(pAct->GetBitmap()).GetBitmap().CreateColorBitmap() );
 
                     pAct = new MetaBmpScaleAction( pAct->GetPoint(), 
pAct->GetSize(), aBmp );
                     aMtf.AddAction( pAct );
@@ -830,7 +830,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMPSCALEPART:
                 {
                     MetaBmpScalePartAction* pAct = 
static_cast<MetaBmpScalePartAction*>(pAction);
-                    const Bitmap            aBmp( 
Mask(BitmapEx(pAct->GetBitmap())).GetBitmap().CreateColorBitmap() );
+                    const Bitmap            aBmp( 
Mask(pAct->GetBitmap()).GetBitmap().CreateColorBitmap() );
 
                     pAct = new MetaBmpScalePartAction( pAct->GetDestPoint(), 
pAct->GetDestSize(),
                                                        pAct->GetSrcPoint(), 
pAct->GetSrcSize(), aBmp );
@@ -841,7 +841,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMPEX:
                 {
                     MetaBmpExAction*    pAct = 
static_cast<MetaBmpExAction*>(pAction);
-                    const BitmapEx      aBmpEx( Mask( pAct->GetBitmapEx() 
).GetBitmap() );
+                    const BitmapEx      aBmpEx( Mask( 
Bitmap(pAct->GetBitmapEx()) ).GetBitmap() );
 
                     pAct = new MetaBmpExAction( pAct->GetPoint(), aBmpEx );
                     aMtf.AddAction( pAct );
@@ -851,7 +851,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMPEXSCALE:
                 {
                     MetaBmpExScaleAction*   pAct = 
static_cast<MetaBmpExScaleAction*>(pAction);
-                    const BitmapEx          aBmpEx( Mask( pAct->GetBitmapEx() 
).GetBitmap() );
+                    const BitmapEx          aBmpEx( Mask( 
Bitmap(pAct->GetBitmapEx()) ).GetBitmap() );
 
                     pAct = new MetaBmpExScaleAction( pAct->GetPoint(), 
pAct->GetSize(), aBmpEx );
                     aMtf.AddAction( pAct );
@@ -861,7 +861,7 @@ GDIMetaFile SvxBmpMask::ImpMask( const GDIMetaFile& rMtf )
                 case MetaActionType::BMPEXSCALEPART:
                 {
                     MetaBmpExScalePartAction*   pAct = 
static_cast<MetaBmpExScalePartAction*>(pAction);
-                    const BitmapEx              aBmpEx( Mask( 
pAct->GetBitmapEx() ).GetBitmap() );
+                    const BitmapEx              aBmpEx( Mask( 
Bitmap(pAct->GetBitmapEx()) ).GetBitmap() );
 
                     pAct = new MetaBmpExScalePartAction( pAct->GetDestPoint(), 
pAct->GetDestSize(),
                                                          pAct->GetSrcPoint(), 
pAct->GetSrcSize(), aBmpEx );
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index 5354176c6e36..c85af2188ffc 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -105,7 +105,7 @@ tools::PolyPolygon SvxContourDlg::CreateAutoContour( const 
Graphic& rGraphic,
                     // offset of the sub-image within the total animation
                     aTransMap.SetOrigin( Point( rStepBmp.maPositionPixel.X(), 
rStepBmp.maPositionPixel.Y() ) );
                     pVDev->SetMapMode( aTransMap );
-                    pVDev->DrawPolyPolygon( CreateAutoContour( 
rStepBmp.maBitmapEx, pRect ) );
+                    pVDev->DrawPolyPolygon( CreateAutoContour( 
Bitmap(rStepBmp.maBitmapEx), pRect ) );
                 }
 
                 aTransMap.SetOrigin( Point() );
@@ -651,7 +651,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, 
ContourWindow&, rWnd, void )
                 aRedoGraphic = Graphic();
                 aUndoGraphic = aGraphic;
                 Bitmap aBmp = aGraphic.GetBitmap().CreateColorBitmap();
-                aGraphic = Graphic( BitmapEx( aBmp, aMask ) );
+                aGraphic = Graphic( Bitmap(BitmapEx( aBmp, aMask )) );
                 mnGrfChanged++;
 
                 bNewContour = (xQBox->run() == RET_YES);
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 03a950a89f6f..5f44de53a7ee 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -577,8 +577,8 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj1, 
bool bScale)
                         const Size aClipSize(
                             
basegfx::fround<tools::Long>(ceil(std::min(static_cast<double>(aOrigSizePixel.Width()),
 aPixel.getWidth()))),
                             
basegfx::fround<tools::Long>(ceil(std::min(static_cast<double>(aOrigSizePixel.Height()),
 aPixel.getHeight()))));
-                        const BitmapEx aClippedBitmap(
-                            BitmapEx(aBitmap),
+                        const Bitmap aClippedBitmap(
+                            aBitmap,
                             aClipTopLeft,
                             aClipSize);
 
@@ -1133,7 +1133,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExAction 
const & rAct)
     aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
     rtl::Reference<SdrGrafObj> pGraf = new SdrGrafObj(
         *mpModel,
-        rAct.GetBitmapEx(),
+        Bitmap(rAct.GetBitmapEx()),
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
@@ -1148,7 +1148,7 @@ void 
ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScaleAction const & rAct)
     aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
     rtl::Reference<SdrGrafObj> pGraf = new SdrGrafObj(
         *mpModel,
-        rAct.GetBitmapEx(),
+        Bitmap(rAct.GetBitmapEx()),
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
@@ -1310,14 +1310,14 @@ void 
ImpSdrGDIMetaFileImport::DoAction(MetaTextRectAction const & rAct)
 void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScalePartAction const & rAct)
 {
     tools::Rectangle aRect(rAct.GetDestPoint(), rAct.GetDestSize());
-    BitmapEx aBitmapEx(rAct.GetBitmap());
+    Bitmap aBitmap(rAct.GetBitmap());
 
     aRect.AdjustRight( 1 );
     aRect.AdjustBottom( 1 );
-    aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
+    aBitmap.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
     rtl::Reference<SdrGrafObj> pGraf = new SdrGrafObj(
         *mpModel,
-        aBitmapEx,
+        aBitmap,
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
@@ -1329,14 +1329,14 @@ void 
ImpSdrGDIMetaFileImport::DoAction(MetaBmpScalePartAction const & rAct)
 void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScalePartAction const & rAct)
 {
     tools::Rectangle aRect(rAct.GetDestPoint(),rAct.GetDestSize());
-    BitmapEx aBitmapEx(rAct.GetBitmapEx());
+    Bitmap aBitmap(rAct.GetBitmapEx());
 
     aRect.AdjustRight( 1 );
     aRect.AdjustBottom( 1 );
-    aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
+    aBitmap.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
     rtl::Reference<SdrGrafObj> pGraf = new SdrGrafObj(
         *mpModel,
-        aBitmapEx,
+        aBitmap,
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
@@ -1353,7 +1353,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMaskAction 
const & rAct)
     aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
     rtl::Reference<SdrGrafObj> pGraf = new SdrGrafObj(
         *mpModel,
-        aBitmapEx,
+        Bitmap(aBitmapEx),
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
@@ -1370,7 +1370,7 @@ void 
ImpSdrGDIMetaFileImport::DoAction(MetaMaskScaleAction const & rAct)
     aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
     rtl::Reference<SdrGrafObj> pGraf = new SdrGrafObj(
         *mpModel,
-        aBitmapEx,
+        Bitmap(aBitmapEx),
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
@@ -1388,7 +1388,7 @@ void 
ImpSdrGDIMetaFileImport::DoAction(MetaMaskScalePartAction const & rAct)
     aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
     rtl::Reference<SdrGrafObj> pGraf = new SdrGrafObj(
         *mpModel,
-        aBitmapEx,
+        Bitmap(aBitmapEx),
         aRect);
 
     // This action is not creating line and fill, set directly, do not use 
SetAttributes(..)
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 56a9edf79f50..3873e5fe5274 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -533,7 +533,7 @@ void ImpSdrPdfImport::InsertObj(SdrObject* pObj1, bool 
bScale)
                             basegfx::fround<tools::Long>(
                                 
ceil(std::min(static_cast<double>(aOrigSizePixel.Height()),
                                               aPixel.getHeight()))));
-                        const BitmapEx aClippedBitmap(BitmapEx(aBitmap), 
aClipTopLeft, aClipSize);
+                        const Bitmap aClippedBitmap(aBitmap, aClipTopLeft, 
aClipSize);
 
                         
pObj->SetMergedItem(XFillStyleItem(drawing::FillStyle_BITMAP));
                         pObj->SetMergedItem(XFillBitmapItem(OUString(), 
Graphic(aClippedBitmap)));
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index ba0924e33179..5d8eb2680da0 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -316,7 +316,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, 
OUString& rFileName,
 
                     pVDev->SetRasterOp( RasterOp::Xor );
                     pVDev->DrawBitmap( aPt, aSize, aBitmap );
-                    aGraphic = BitmapEx( aBitmap, pVDev->GetBitmap( aPt, aSize 
) );
+                    aGraphic = Bitmap(BitmapEx( aBitmap, pVDev->GetBitmap( 
aPt, aSize ) ));
                 }
                 else
                 {
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 1d7a9623a3f1..b0a2f572a4eb 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -145,7 +145,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, 
const OUString &rText,
 
     const Bitmap& rBmp = bDefect ? 
const_cast<SwViewShell&>(rSh).GetErrorBitmap()
                                  : 
const_cast<SwViewShell&>(rSh).GetReplacementBitmap();
-    Graphic::DrawEx(*rSh.GetOut(), rText, aFont, BitmapEx(rBmp), rRect.Pos(), 
rRect.SSize());
+    Graphic::DrawEx(*rSh.GetOut(), rText, aFont, rBmp, rRect.Pos(), 
rRect.SSize());
 }
 
 SwNoTextFrame::SwNoTextFrame(SwNoTextNode * const pNode, SwFrame* pSib )
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index da13badc60e8..40f2559279c4 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2111,7 +2111,7 @@ void DrawGraphic(
     {
         const Bitmap& rBmp = rSh.GetReplacementBitmap();
         vcl::Font aTmp( rOutDev.GetFont() );
-        Graphic::DrawEx(rOutDev, OUString(), aTmp, BitmapEx(rBmp), rOrg.Pos(), 
rOrg.SSize());
+        Graphic::DrawEx(rOutDev, OUString(), aTmp, rBmp, rOrg.Pos(), 
rOrg.SSize());
     }
 }
 
@@ -4096,7 +4096,7 @@ static void lcl_PaintReplacement( const SwRect &rRect, 
const SwViewShell &rSh )
 {
     const Bitmap& rBmp = const_cast<SwViewShell&>(rSh).GetReplacementBitmap();
     vcl::Font aFont(rSh.GetOut()->GetFont() );
-    Graphic::DrawEx(*rSh.GetOut(), OUString(), aFont, BitmapEx(rBmp), 
rRect.Pos(), rRect.SSize());
+    Graphic::DrawEx(*rSh.GetOut(), OUString(), aFont, rBmp, rRect.Pos(), 
rRect.SSize());
 }
 
 bool SwFlyFrame::IsPaint(SdrObject *pObj, const SwViewShell& rSh)
diff --git a/vcl/qa/api/XGraphicTest.cxx b/vcl/qa/api/XGraphicTest.cxx
index 0e567902d561..fe2ae1209f4e 100644
--- a/vcl/qa/api/XGraphicTest.cxx
+++ b/vcl/qa/api/XGraphicTest.cxx
@@ -52,12 +52,12 @@ public:
     CPPUNIT_TEST_SUITE_END();
 };
 
-BitmapEx createBitmap()
+Bitmap createBitmap()
 {
     Bitmap aBitmap(Size(100, 50), vcl::PixelFormat::N24_BPP);
     aBitmap.Erase(COL_LIGHTRED);
 
-    return BitmapEx(aBitmap);
+    return aBitmap;
 }
 
 void XGraphicTest::testGraphic()
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index 71ed3f25fc52..c7432229414f 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -33,10 +33,10 @@ class BackendTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(rBitmapEx);
-            aBitmapEx.Scale(Size(128, 128), BmpScaleFlag::Fast);
+            Bitmap aBitmap(rBitmapEx);
+            aBitmap.Scale(Size(128, 128), BmpScaleFlag::Fast);
             SvFileStream aStream(rsFilename, StreamMode::WRITE | 
StreamMode::TRUNC);
-            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
+            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream);
         }
     }
 
@@ -47,7 +47,7 @@ class BackendTest : public test::BootstrapFixture
             Bitmap aBitmap(rBitmap);
             aBitmap.Scale(Size(128, 128), BmpScaleFlag::Fast);
             SvFileStream aStream(rsFilename, StreamMode::WRITE | 
StreamMode::TRUNC);
-            GraphicFilter::GetGraphicFilter().compressAsPNG(BitmapEx(aBitmap), 
aStream);
+            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream);
         }
     }
 
@@ -55,9 +55,9 @@ class BackendTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
+            Bitmap aBitmap(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             SvFileStream aStream(filename, StreamMode::WRITE | 
StreamMode::TRUNC);
-            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, 
aStream);
+            GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream);
         }
     }
 
diff --git a/vcl/qa/cppunit/BitmapFilterTest.cxx 
b/vcl/qa/cppunit/BitmapFilterTest.cxx
index eff09c98eea8..db07129f36cc 100644
--- a/vcl/qa/cppunit/BitmapFilterTest.cxx
+++ b/vcl/qa/cppunit/BitmapFilterTest.cxx
@@ -89,7 +89,7 @@ private:
     {
         SvFileStream aStream(sWhere, StreamMode::WRITE | StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(BitmapEx(rBmp), aStream);
+        rFilter.compressAsPNG(rBmp, aStream);
     }
 };
 
@@ -237,7 +237,7 @@ void BitmapFilterTest::testPerformance()
         std::unique_ptr<SvFileStream> pStream(new SvFileStream(
             u"~/BlurBigPerformance.png"_ustr, StreamMode::WRITE | 
StreamMode::TRUNC));
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(BitmapEx(aResult), *pStream);
+        rFilter.compressAsPNG(aResult, *pStream);
 
         pStream.reset(new SvFileStream(u"~/BlurBigPerformance.txt"_ustr, 
StreamMode::WRITE));
         pStream->WriteOString("Blur average time: ");
diff --git a/vcl/qa/cppunit/BitmapScaleTest.cxx 
b/vcl/qa/cppunit/BitmapScaleTest.cxx
index 4559b1d3eef3..1a3b899a9bb6 100644
--- a/vcl/qa/cppunit/BitmapScaleTest.cxx
+++ b/vcl/qa/cppunit/BitmapScaleTest.cxx
@@ -135,7 +135,7 @@ void BitmapScaleTest::testScale()
                 SvFileStream aStream(u"~/scale_before.png"_ustr,
                                      StreamMode::WRITE | StreamMode::TRUNC);
                 GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-                rFilter.compressAsPNG(BitmapEx(bitmap), aStream);
+                rFilter.compressAsPNG(bitmap, aStream);
             }
             CPPUNIT_ASSERT(bitmap.Scale(scaleSize.destSize, scaleMethod));
             if (bExportBitmap)
@@ -143,7 +143,7 @@ void BitmapScaleTest::testScale()
                 SvFileStream aStream(u"~/scale_after.png"_ustr,
                                      StreamMode::WRITE | StreamMode::TRUNC);
                 GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-                rFilter.compressAsPNG(BitmapEx(bitmap), aStream);
+                rFilter.compressAsPNG(bitmap, aStream);
             }
             CPPUNIT_ASSERT_EQUAL(scaleSize.destSize, bitmap.GetSizePixel());
             const int lastW = scaleSize.destSize.getWidth() - 1;
@@ -205,7 +205,7 @@ void BitmapScaleTest::testScale2()
     {
         SvFileStream aStream(u"scale_before.png"_ustr, StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(BitmapEx(aBitmap24Bit), aStream);
+        rFilter.compressAsPNG(aBitmap24Bit, aStream);
     }
 
     // Scale - 65x65
@@ -218,7 +218,7 @@ void BitmapScaleTest::testScale2()
     {
         SvFileStream aStream(u"scale_after_65x65.png"_ustr, StreamMode::WRITE 
| StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(BitmapEx(aScaledBitmap), aStream);
+        rFilter.compressAsPNG(aScaledBitmap, aStream);
     }
 
     CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(65), 
aScaledBitmap.GetSizePixel().Width());
@@ -235,7 +235,7 @@ void BitmapScaleTest::testScale2()
     {
         SvFileStream aStream(u"scale_after_64x64.png"_ustr, StreamMode::WRITE 
| StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(BitmapEx(aScaledBitmap), aStream);
+        rFilter.compressAsPNG(aScaledBitmap, aStream);
     }
 
     CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(64), 
aScaledBitmap.GetSizePixel().Width());
@@ -252,7 +252,7 @@ void BitmapScaleTest::testScale2()
     {
         SvFileStream aStream(u"scale_after_63x63.png"_ustr, StreamMode::WRITE 
| StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(BitmapEx(aScaledBitmap), aStream);
+        rFilter.compressAsPNG(aScaledBitmap, aStream);
     }
 
     CPPUNIT_ASSERT_EQUAL(static_cast<tools::Long>(63), 
aScaledBitmap.GetSizePixel().Width());
@@ -287,7 +287,7 @@ void BitmapScaleTest::testScaleSymmetry()
     {
         SvFileStream aStream(u"~/scale_before.png"_ustr, StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(BitmapEx(aBitmap24Bit), aStream);
+        rFilter.compressAsPNG(aBitmap24Bit, aStream);
     }
 
     aBitmap24Bit.Scale(2, 2, BmpScaleFlag::Fast);
@@ -303,7 +303,7 @@ void BitmapScaleTest::testScaleSymmetry()
     {
         SvFileStream aStream(u"~/scale_after.png"_ustr, StreamMode::WRITE | 
StreamMode::TRUNC);
         GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
-        rFilter.compressAsPNG(BitmapEx(aBitmap24Bit), aStream);
+        rFilter.compressAsPNG(aBitmap24Bit, aStream);
     }
 }
 
diff --git a/vcl/qa/cppunit/GraphicDescriptorTest.cxx 
b/vcl/qa/cppunit/GraphicDescriptorTest.cxx
index db8cfb22ca84..af4859195291 100644
--- a/vcl/qa/cppunit/GraphicDescriptorTest.cxx
+++ b/vcl/qa/cppunit/GraphicDescriptorTest.cxx
@@ -49,22 +49,22 @@ class GraphicDescriptorTest : public 
test::BootstrapFixtureBase
     CPPUNIT_TEST_SUITE_END();
 };
 
-BitmapEx createBitmap()
+Bitmap createBitmap()
 {
     Bitmap aBitmap(Size(100, 100), vcl::PixelFormat::N24_BPP);
     aBitmap.Erase(COL_LIGHTRED);
 
-    return BitmapEx(aBitmap);
+    return aBitmap;
 }
 
 void createBitmapAndExportForType(SvStream& rStream, std::u16string_view sType)
 {
-    BitmapEx aBitmapEx = createBitmap();
+    Bitmap aBitmap = createBitmap();
 
     uno::Sequence<beans::PropertyValue> aFilterData;
     GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
     sal_uInt16 nFilterFormat = 
rGraphicFilter.GetExportFormatNumberForShortName(sType);
-    rGraphicFilter.ExportGraphic(aBitmapEx, u"none", rStream, nFilterFormat, 
&aFilterData);
+    rGraphicFilter.ExportGraphic(aBitmap, u"none", rStream, nFilterFormat, 
&aFilterData);
 
     rStream.Seek(STREAM_SEEK_TO_BEGIN);
 }
diff --git a/vcl/qa/cppunit/GraphicMemoryTest.cxx 
b/vcl/qa/cppunit/GraphicMemoryTest.cxx
index b80cc4dd30e0..b5b664062c38 100644
--- a/vcl/qa/cppunit/GraphicMemoryTest.cxx
+++ b/vcl/qa/cppunit/GraphicMemoryTest.cxx
@@ -22,7 +22,7 @@ using namespace css;
 
 namespace
 {
-BitmapEx createBitmap(Size aSize, bool bAlpha = false)
+Bitmap createBitmap(Size aSize, bool bAlpha = false)
 {
     Bitmap aBitmap(aSize, vcl::PixelFormat::N24_BPP);
     aBitmap.Erase(COL_LIGHTRED);
@@ -35,23 +35,23 @@ BitmapEx createBitmap(Size aSize, bool bAlpha = false)
         sal_uInt8 uAlphaValue = 0x80;
         AlphaMask aAlphaMask(aSize, &uAlphaValue);
 
-        return BitmapEx(aBitmap, aAlphaMask);
+        return Bitmap(BitmapEx(aBitmap, aAlphaMask));
     }
     else
     {
-        return BitmapEx(aBitmap);
+        return aBitmap;
     }
 }
 
 void createBitmapAndExportForType(SvStream& rStream, std::u16string_view sType,
                                   Size aSize = Size(120, 100), bool bAlpha = 
false)
 {
-    BitmapEx aBitmapEx = createBitmap(aSize, bAlpha);
+    Bitmap aBitmap = createBitmap(aSize, bAlpha);
 
     uno::Sequence<beans::PropertyValue> aFilterData;
     GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
     sal_uInt16 nFilterFormat = 
rGraphicFilter.GetExportFormatNumberForShortName(sType);
-    rGraphicFilter.ExportGraphic(aBitmapEx, u"none", rStream, nFilterFormat, 
&aFilterData);
+    rGraphicFilter.ExportGraphic(aBitmap, u"none", rStream, nFilterFormat, 
&aFilterData);
 
     rStream.Seek(STREAM_SEEK_TO_BEGIN);
 }
diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx
index dc655f77fced..e45912a9a400 100644
--- a/vcl/qa/cppunit/GraphicTest.cxx
+++ b/vcl/qa/cppunit/GraphicTest.cxx
@@ -52,7 +52,7 @@ GraphicTest::~GraphicTest()
 
 namespace
 {
-BitmapEx createBitmap(bool alpha = false)
+Bitmap createBitmap(bool alpha = false)
 {
     Bitmap aBitmap(Size(120, 100), vcl::PixelFormat::N24_BPP);
     aBitmap.Erase(COL_LIGHTRED);
@@ -65,22 +65,22 @@ BitmapEx createBitmap(bool alpha = false)
         sal_uInt8 uAlphaValue = 0x80;
         AlphaMask aAlphaMask(Size(120, 100), &uAlphaValue);
 
-        return BitmapEx(aBitmap, aAlphaMask);
+        return Bitmap(BitmapEx(aBitmap, aAlphaMask));
     }
     else
     {
-        return BitmapEx(aBitmap);
+        return aBitmap;
     }
 }
 
 void createBitmapAndExportForType(SvStream& rStream, std::u16string_view 
sType, bool alpha)
 {
-    BitmapEx aBitmapEx = createBitmap(alpha);
+    Bitmap aBitmap = createBitmap(alpha);
 
     uno::Sequence<beans::PropertyValue> aFilterData;
     GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
     sal_uInt16 nFilterFormat = 
rGraphicFilter.GetExportFormatNumberForShortName(sType);
-    rGraphicFilter.ExportGraphic(aBitmapEx, u"none", rStream, nFilterFormat, 
&aFilterData);
+    rGraphicFilter.ExportGraphic(aBitmap, u"none", rStream, nFilterFormat, 
&aFilterData);
 
     rStream.Seek(STREAM_SEEK_TO_BEGIN);
 }
@@ -297,11 +297,11 @@ CPPUNIT_TEST_FIXTURE(GraphicTest, 
testUnloadedGraphicLoadingWebp)
 CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicWmf)
 {
     // Create some in-memory WMF data, set its own preferred size to 99x99.
-    BitmapEx aBitmapEx = createBitmap();
+    Bitmap aBitmap = createBitmap();
     SvMemoryStream aStream;
     GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
     sal_uInt16 nFilterFormat = 
rGraphicFilter.GetExportFormatNumberForShortName(u"wmf");
-    Graphic aGraphic(aBitmapEx);
+    Graphic aGraphic(aBitmap);
     aGraphic.SetPrefSize(Size(99, 99));
     aGraphic.SetPrefMapMode(MapMode(MapUnit::Map100thMM));
     rGraphicFilter.ExportGraphic(aGraphic, u"none", aStream, nFilterFormat);
diff --git a/vcl/qa/cppunit/cjktext.cxx b/vcl/qa/cppunit/cjktext.cxx
index 59ae66492885..9550a16e9837 100644
--- a/vcl/qa/cppunit/cjktext.cxx
+++ b/vcl/qa/cppunit/cjktext.cxx
@@ -30,15 +30,15 @@ class VclCjkTextTest : public test::BootstrapFixture
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
+            Bitmap aBitmap(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             OUString cwd;
             CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, 
osl_getProcessWorkingDir(&cwd.pData));
             OUString url;
             CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None,
                                  osl::FileBase::getAbsoluteFileURL(cwd, 
filename, url));
             SvFileStream aStream(url, StreamMode::WRITE | StreamMode::TRUNC);
-            CPPUNIT_ASSERT_EQUAL(
-                ERRCODE_NONE, 
GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, aStream));
+            CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE,
+                                 
GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream));
         }
     }
 
diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx 
b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
index 8ac8090b072a..4020af159a6d 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx
@@ -119,7 +119,7 @@ void VclFiltersTest::checkExportImport(std::u16string_view 
aFilterShortName)
     };
 
     sal_uInt16 aFilterType = 
mpGraphicFilter->GetExportFormatNumberForShortName(aFilterShortName);
-    mpGraphicFilter->ExportGraphic(BitmapEx(aBitmap), u"", aStream, 
aFilterType, &aFilterData );
+    mpGraphicFilter->ExportGraphic(aBitmap, u"", aStream, aFilterType, 
&aFilterData );
 
     CPPUNIT_ASSERT(aStream.Tell() > 0);
 
diff --git a/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx 
b/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx
index f9ebda83795c..7ce03da6c599 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx
@@ -211,7 +211,7 @@ void TiffFilterTest::testRoundtrip()
     SvMemoryStream aStream;
     GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
     sal_uInt16 nFilterFormat = 
rFilter.GetExportFormatNumberForShortName(u"tif");
-    rFilter.ExportGraphic(Graphic(BitmapEx(aBitmap)), u"none", aStream, 
nFilterFormat);
+    rFilter.ExportGraphic(Graphic(aBitmap), u"none", aStream, nFilterFormat);
     aStream.Seek(STREAM_SEEK_TO_BEGIN);
 
     Graphic aGraphic;
diff --git a/vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx 
b/vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx
index d44093da9365..12ce549fcf44 100644
--- a/vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx
+++ b/vcl/qa/cppunit/graphicfilter/filters-webp-test.cxx
@@ -110,7 +110,8 @@ void WebpFilterTest::testRoundtrip(bool lossy)
         comphelper::makePropertyValue(u"Lossless"_ustr, !lossy),
         comphelper::makePropertyValue(u"Quality"_ustr, sal_Int32(100))
     };
-    rFilter.ExportGraphic(Graphic(aBitmapEx), u"none", aStream, nFilterFormat, 
&aFilterData);
+    rFilter.ExportGraphic(Graphic(Bitmap(aBitmapEx)), u"none", aStream, 
nFilterFormat,
+                          &aFilterData);
     aStream.Seek(STREAM_SEEK_TO_BEGIN);
 
     Graphic aGraphic;
diff --git a/vcl/qa/cppunit/png/PngFilterTest.cxx 
b/vcl/qa/cppunit/png/PngFilterTest.cxx
index 9bc4b03d4680..c772ca7f599d 100644
--- a/vcl/qa/cppunit/png/PngFilterTest.cxx
+++ b/vcl/qa/cppunit/png/PngFilterTest.cxx
@@ -1739,7 +1739,7 @@ void PngFilterTest::testMsGifInPng()
             aTempFile.EnableKillingFile();
         {
             SvStream& rStream = *aTempFile.GetStream(StreamMode::WRITE);
-            BitmapEx aDummyBitmap(Size(8, 8), vcl::PixelFormat::N24_BPP);
+            Bitmap aDummyBitmap(Size(8, 8), vcl::PixelFormat::N24_BPP);
             vcl::PngImageWriter aPngWriter(rStream);
             aPngWriter.setParameters(aPNGParameters);
             bool bWriteSuccess = aPngWriter.write(aDummyBitmap);
@@ -1786,10 +1786,9 @@ void PngFilterTest::testPngRoundtrip8BitGrey()
                 }
             }
         }
-        BitmapEx aBitmapEx(aBitmap);
 
         vcl::PngImageWriter aPngWriter(rStream);
-        CPPUNIT_ASSERT_EQUAL(true, aPngWriter.write(aBitmapEx));
+        CPPUNIT_ASSERT_EQUAL(true, aPngWriter.write(aBitmap));
         aTempFile.CloseStream();
     }
     {
@@ -1834,10 +1833,9 @@ void PngFilterTest::testPngRoundtrip24()
                 }
             }
         }
-        BitmapEx aBitmapEx(aBitmap);
 
         vcl::PngImageWriter aPngWriter(rStream);
-        CPPUNIT_ASSERT_EQUAL(true, aPngWriter.write(aBitmapEx));
+        CPPUNIT_ASSERT_EQUAL(true, aPngWriter.write(aBitmap));
     }
     {
         SvStream& rStream = *aTempFile.GetStream(StreamMode::READ);
@@ -1889,7 +1887,7 @@ void PngFilterTest::testPngRoundtrip24_8()
         }
         BitmapEx aBitmapEx(aBitmap, aAlpha);
         vcl::PngImageWriter aPngWriter(rStream);
-        CPPUNIT_ASSERT_EQUAL(true, aPngWriter.write(aBitmapEx));
+        CPPUNIT_ASSERT_EQUAL(true, aPngWriter.write(Bitmap(aBitmapEx)));
     }
     {
         SvStream& rStream = *aTempFile.GetStream(StreamMode::READ);
@@ -1937,9 +1935,8 @@ void PngFilterTest::testPngWrite8BitRGBPalette()
                 }
             }
         }
-        BitmapEx aBitmapEx(aBitmap);
         vcl::PngImageWriter aPngWriter(aExportStream);
-        CPPUNIT_ASSERT_EQUAL(true, aPngWriter.write(aBitmapEx));
+        CPPUNIT_ASSERT_EQUAL(true, aPngWriter.write(aBitmap));
     }
     aExportStream.Seek(0);
     {
@@ -1981,7 +1978,7 @@ void 
PngFilterTest::testTdf153180MonochromeFilterPngExport()
     Bitmap aTmpBmp(aBitmap.CreateColorBitmap());
     BitmapFilter::Filter(aTmpBmp, BitmapMonochromeFilter{ sal_uInt8{ 127 } });
 
-    Graphic aGraphicAfterFilter{ BitmapEx(aTmpBmp, aAlphaMask) };
+    Graphic aGraphicAfterFilter{ Bitmap(BitmapEx(aTmpBmp, aAlphaMask)) };
     CPPUNIT_ASSERT(aGraphicAfterFilter.IsAlpha());
 
     // export the resulting graphic
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 5709a4d5d965..fd70153ce485 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -274,11 +274,11 @@ static void setupBaseVirtualDevice(VirtualDevice& 
rDevice, GDIMetaFile& rMeta)
 
 void SvmTest::checkRendering(ScopedVclPtrInstance<VirtualDevice> const & 
pVirtualDev, const GDIMetaFile& rMetaFile, const char * where)
 {
-    BitmapEx aSourceBitmapEx( pVirtualDev->GetBitmap(Point(), Size(10, 10)) );
+    Bitmap aSourceBitmap( pVirtualDev->GetBitmap(Point(), Size(10, 10)) );
     ScopedVclPtrInstance<VirtualDevice> pVirtualDevResult;
     pVirtualDevResult->SetOutputSizePixel(Size(10, 10));
     const_cast<GDIMetaFile&>(rMetaFile).Play(*pVirtualDevResult);
-    BitmapEx aResultBitmapEx( pVirtualDevResult->GetBitmap(Point(), Size(10, 
10)) );
+    Bitmap aResultBitmap( pVirtualDevResult->GetBitmap(Point(), Size(10, 10)) 
);
 
     const bool bWriteCompareBitmap = false;
 
@@ -290,15 +290,15 @@ void 
SvmTest::checkRendering(ScopedVclPtrInstance<VirtualDevice> const & pVirtua
         {
             SvFileStream aStream(aTempFile.GetURL() + ".source.png", 
StreamMode::WRITE | StreamMode::TRUNC);
             vcl::PngImageWriter aPNGWriter(aStream);
-            aPNGWriter.write(aSourceBitmapEx);
+            aPNGWriter.write(aSourceBitmap);
         }
         {
             SvFileStream aStream(aTempFile.GetURL() + ".result.png", 
StreamMode::WRITE | StreamMode::TRUNC);
             vcl::PngImageWriter aPNGWriter(aStream);
-            aPNGWriter.write(aResultBitmapEx);
+            aPNGWriter.write(aSourceBitmap);
         }
     }
-    CPPUNIT_ASSERT_EQUAL_MESSAGE(where, aSourceBitmapEx.GetChecksum(), 
aResultBitmapEx.GetChecksum());
+    CPPUNIT_ASSERT_EQUAL_MESSAGE(where, aSourceBitmap.GetChecksum(), 
aResultBitmap.GetChecksum());
 }
 
 static GDIMetaFile readMetafile(const OUString& rUrl)
diff --git a/vcl/qa/cppunit/text.cxx b/vcl/qa/cppunit/text.cxx
index c9a1be609977..c9ae8f7c7222 100644
--- a/vcl/qa/cppunit/text.cxx
+++ b/vcl/qa/cppunit/text.cxx
@@ -32,15 +32,15 @@ public:
     {
         if (mbExportBitmap)
         {
-            BitmapEx aBitmapEx(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
+            Bitmap aBitmap(device->GetBitmap(Point(0, 0), 
device->GetOutputSizePixel()));
             OUString cwd;
             CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, 
osl_getProcessWorkingDir(&cwd.pData));
             OUString url;
             CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None,
                                  osl::FileBase::getAbsoluteFileURL(cwd, 
filename, url));
             SvFileStream aStream(url, StreamMode::WRITE | StreamMode::TRUNC);
-            CPPUNIT_ASSERT_EQUAL(
-                ERRCODE_NONE, 
GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmapEx, aStream));
+            CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE,
+                                 
GraphicFilter::GetGraphicFilter().compressAsPNG(aBitmap, aStream));
         }
     }
 
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index dcc349f5734b..c920b643685d 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -1446,7 +1446,7 @@ void BitmapEx::DumpAsPng(const char* pFileName) const
     SvFileStream aStream(sPath, StreamMode::STD_READWRITE | StreamMode::TRUNC);
     assert(aStream.good());
     vcl::PngImageWriter aWriter(aStream);
-    aWriter.write(*this);
+    aWriter.write(Bitmap(*this));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index 0043e9ab9db5..57f39d84313f 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -342,7 +342,7 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
     if (nImages)
     {
         if (nImages == 1)
-            rGraphic = aAnimation.GetBitmapEx();
+            rGraphic = Bitmap(aAnimation.GetBitmapEx());
         else
             rGraphic = aAnimation;
 
diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx
index 0ac9a5f89e58..fb8db09b8680 100644
--- a/vcl/source/gdi/graph.cxx
+++ b/vcl/source/gdi/graph.cxx
@@ -37,14 +37,14 @@ namespace
 {
 
 void ImplDrawDefault(OutputDevice& rOutDev, const OUString* pText,
-                     vcl::Font* pFont, const BitmapEx* pBitmapEx,
+                     vcl::Font* pFont, const Bitmap* pBitmap,
                      const Point& rDestPt, const Size& rDestSize)
 {
     sal_uInt16  nPixel = static_cast<sal_uInt16>(rOutDev.PixelToLogic( Size( 
1, 1 ) ).Width());
     sal_uInt16  nPixelWidth = nPixel;
     Point       aPoint( rDestPt.X() + nPixelWidth, rDestPt.Y() + nPixelWidth );
     Size        aSize( rDestSize.Width() - ( nPixelWidth << 1 ), 
rDestSize.Height() - ( nPixelWidth << 1 ) );
-    bool        bFilled = ( pBitmapEx != nullptr || pFont != nullptr );
+    bool        bFilled = ( pBitmap != nullptr || pFont != nullptr );
     tools::Rectangle   aBorderRect( aPoint, aSize );
 
     auto popIt = rOutDev.ScopedPush();
@@ -59,13 +59,13 @@ void ImplDrawDefault(OutputDevice& rOutDev, const OUString* 
pText,
     aSize.AdjustWidth( -(2*nPixelWidth + 4*nPixel) );
     aSize.AdjustHeight( -(2*nPixelWidth + 4*nPixel) );
 
-    if( !aSize.IsEmpty() && pBitmapEx && !pBitmapEx->IsEmpty() )
+    if( !aSize.IsEmpty() && pBitmap && !pBitmap->IsEmpty() )
     {
-        Size aBitmapSize( rOutDev.PixelToLogic( pBitmapEx->GetSizePixel() ) );
+        Size aBitmapSize( rOutDev.PixelToLogic( pBitmap->GetSizePixel() ) );
 
         if( aSize.Height() > aBitmapSize.Height() && aSize.Width() > 
aBitmapSize.Width() )
         {
-            rOutDev.DrawBitmapEx( aPoint, *pBitmapEx );
+            rOutDev.DrawBitmapEx( aPoint, *pBitmap );
             aPoint.AdjustX(aBitmapSize.Width() + 2*nPixel );
             aSize.AdjustWidth( -(aBitmapSize.Width() + 2*nPixel) );
         }
@@ -187,11 +187,6 @@ Graphic::Graphic(GraphicExternalLink const & 
rGraphicExternalLink)
 {
 }
 
-Graphic::Graphic(const BitmapEx& rBitmapEx)
-    : mxImpGraphic(new ImpGraphic(Bitmap(rBitmapEx)))
-{
-}
-
 Graphic::Graphic(const Bitmap& rBitmap)
     : mxImpGraphic(new ImpGraphic(rBitmap))
 {
@@ -430,7 +425,7 @@ void Graphic::Draw(OutputDevice& rOutDev, const Point& 
rDestPt,
 }
 
 void Graphic::DrawEx(OutputDevice& rOutDev, const OUString& rText,
-                     vcl::Font& rFont, const BitmapEx& rBitmap,
+                     vcl::Font& rFont, const Bitmap& rBitmap,
                      const Point& rDestPt, const Size& rDestSz)
 {
     ImplDrawDefault(rOutDev, &rText, &rFont, &rBitmap, rDestPt, rDestSz);
diff --git a/vcl/source/graphic/UnoGraphic.cxx 
b/vcl/source/graphic/UnoGraphic.cxx
index dd0b3c096af5..796b2d610ac4 100644
--- a/vcl/source/graphic/UnoGraphic.cxx
+++ b/vcl/source/graphic/UnoGraphic.cxx
@@ -202,7 +202,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL 
Graphic::colorChange(
                 Bitmap aBitmap2(aBitmap);
                 AlphaMask aMask(aBitmap2.CreateAlphaMask(aColorFrom, 
nTolerance));
                 aBitmap2.Replace(aColorFrom, aColorTo, nTolerance);
-                aReturnGraphic = ::Graphic(BitmapEx(aBitmap2, aMask));
+                aReturnGraphic = ::Graphic(Bitmap(BitmapEx(aBitmap2, aMask)));
             }
             else
             {

Reply via email to