Kaydet (Commit) 86555baa authored tarafından Noel Grandin's avatar Noel Grandin

Bitmap->BitmapEx in FixedBitmap

Change-Id: I0e409beb0d046d927b6a0c1987abec42df76727d
Reviewed-on: https://gerrit.libreoffice.org/55032Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 7873bba6
...@@ -2611,17 +2611,17 @@ void SvtFileDialog::setImage( sal_Int16 /*aImageFormat*/, const Any& rImage ) ...@@ -2611,17 +2611,17 @@ void SvtFileDialog::setImage( sal_Int16 /*aImageFormat*/, const Any& rImage )
if ( rImage >>= aBmpSequence ) if ( rImage >>= aBmpSequence )
{ {
Bitmap aBmp; BitmapEx aBmp;
SvMemoryStream aData( aBmpSequence.getArray(), SvMemoryStream aData( aBmpSequence.getArray(),
aBmpSequence.getLength(), aBmpSequence.getLength(),
StreamMode::READ ); StreamMode::READ );
ReadDIB(aBmp, aData, true); ReadDIBBitmapEx(aBmp, aData);
_pPrevBmp->SetBitmap( aBmp ); _pPrevBmp->SetBitmap( aBmp );
} }
else else
{ {
Bitmap aEmpty; BitmapEx aEmpty;
_pPrevBmp->SetBitmap( aEmpty ); _pPrevBmp->SetBitmap( aEmpty );
} }
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <tools/solar.h> #include <tools/solar.h>
#include <vcl/dllapi.h> #include <vcl/dllapi.h>
#include <vcl/bitmap.hxx> #include <vcl/bitmapex.hxx>
#include <vcl/ctrl.hxx> #include <vcl/ctrl.hxx>
#include <vcl/edit.hxx> #include <vcl/edit.hxx>
#include <vcl/image.hxx> #include <vcl/image.hxx>
...@@ -121,7 +121,7 @@ public: ...@@ -121,7 +121,7 @@ public:
class VCL_DLLPUBLIC FixedBitmap : public Control class VCL_DLLPUBLIC FixedBitmap : public Control
{ {
private: private:
Bitmap maBitmap; BitmapEx maBitmap;
using Control::ImplInitSettings; using Control::ImplInitSettings;
using Window::ImplInit; using Window::ImplInit;
...@@ -140,7 +140,7 @@ public: ...@@ -140,7 +140,7 @@ public:
virtual void StateChanged( StateChangedType nType ) override; virtual void StateChanged( StateChangedType nType ) override;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
void SetBitmap( const Bitmap& rBitmap ); void SetBitmap( const BitmapEx& rBitmap );
using OutputDevice::GetBitmap; using OutputDevice::GetBitmap;
}; };
......
...@@ -692,17 +692,15 @@ FixedBitmap::FixedBitmap( vcl::Window* pParent, WinBits nStyle ) : ...@@ -692,17 +692,15 @@ FixedBitmap::FixedBitmap( vcl::Window* pParent, WinBits nStyle ) :
void FixedBitmap::ImplDraw( OutputDevice* pDev, const Point& rPos, const Size& rSize ) void FixedBitmap::ImplDraw( OutputDevice* pDev, const Point& rPos, const Size& rSize )
{ {
Bitmap* pBitmap = &maBitmap;
// do we have a Bitmap? // do we have a Bitmap?
if ( !(!(*pBitmap)) ) if ( !!maBitmap )
{ {
if ( GetStyle() & WB_SCALE ) if ( GetStyle() & WB_SCALE )
pDev->DrawBitmap( rPos, rSize, *pBitmap ); pDev->DrawBitmapEx( rPos, rSize, maBitmap );
else else
{ {
Point aPos = ImplCalcPos( GetStyle(), rPos, pBitmap->GetSizePixel(), rSize ); Point aPos = ImplCalcPos( GetStyle(), rPos, maBitmap.GetSizePixel(), rSize );
pDev->DrawBitmap( aPos, *pBitmap ); pDev->DrawBitmapEx( aPos, maBitmap );
} }
} }
} }
...@@ -799,7 +797,7 @@ void FixedBitmap::DataChanged( const DataChangedEvent& rDCEvt ) ...@@ -799,7 +797,7 @@ void FixedBitmap::DataChanged( const DataChangedEvent& rDCEvt )
} }
} }
void FixedBitmap::SetBitmap( const Bitmap& rBitmap ) void FixedBitmap::SetBitmap( const BitmapEx& rBitmap )
{ {
maBitmap = rBitmap; maBitmap = rBitmap;
CompatStateChanged( StateChangedType::Data ); CompatStateChanged( StateChangedType::Data );
......
...@@ -65,7 +65,7 @@ class MyWorkWindow : public WorkWindow ...@@ -65,7 +65,7 @@ class MyWorkWindow : public WorkWindow
public: public:
Graphic maGraphic; Graphic maGraphic;
Bitmap *mpBitmap; BitmapEx *mpBitmap;
VclPtr<FixedBitmap> mpFixedBitmap; VclPtr<FixedBitmap> mpFixedBitmap;
MyWorkWindow( vcl::Window* pParent, WinBits nWinStyle ); MyWorkWindow( vcl::Window* pParent, WinBits nWinStyle );
...@@ -112,10 +112,10 @@ void MyWorkWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan ...@@ -112,10 +112,10 @@ void MyWorkWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
aSize.setWidth( aSize.Width() * (1 + (0.1*sin(mnPaintCount/60.))) ); aSize.setWidth( aSize.Width() * (1 + (0.1*sin(mnPaintCount/60.))) );
aSize.setHeight( aSize.Height() * (1 + (0.1*sin(mnPaintCount/50.))) ); aSize.setHeight( aSize.Height() * (1 + (0.1*sin(mnPaintCount/50.))) );
Bitmap aEmpty; BitmapEx aEmpty;
mpFixedBitmap->SetBitmap( aEmpty ); mpFixedBitmap->SetBitmap( aEmpty );
GraphicConversionParameters aConv( aSize ); GraphicConversionParameters aConv( aSize );
mpBitmap = new Bitmap( maGraphic.GetBitmap( aConv ) ); mpBitmap = new BitmapEx( maGraphic.GetBitmap( aConv ) );
mpFixedBitmap->SetBitmap( *mpBitmap ); mpFixedBitmap->SetBitmap( *mpBitmap );
mpFixedBitmap->SetSizePixel( aSize ); mpFixedBitmap->SetSizePixel( aSize );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment