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 )
if ( rImage >>= aBmpSequence )
{
Bitmap aBmp;
BitmapEx aBmp;
SvMemoryStream aData( aBmpSequence.getArray(),
aBmpSequence.getLength(),
StreamMode::READ );
ReadDIB(aBmp, aData, true);
ReadDIBBitmapEx(aBmp, aData);
_pPrevBmp->SetBitmap( aBmp );
}
else
{
Bitmap aEmpty;
BitmapEx aEmpty;
_pPrevBmp->SetBitmap( aEmpty );
}
}
......
......@@ -22,7 +22,7 @@
#include <tools/solar.h>
#include <vcl/dllapi.h>
#include <vcl/bitmap.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/ctrl.hxx>
#include <vcl/edit.hxx>
#include <vcl/image.hxx>
......@@ -121,7 +121,7 @@ public:
class VCL_DLLPUBLIC FixedBitmap : public Control
{
private:
Bitmap maBitmap;
BitmapEx maBitmap;
using Control::ImplInitSettings;
using Window::ImplInit;
......@@ -140,7 +140,7 @@ public:
virtual void StateChanged( StateChangedType nType ) override;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
void SetBitmap( const Bitmap& rBitmap );
void SetBitmap( const BitmapEx& rBitmap );
using OutputDevice::GetBitmap;
};
......
......@@ -692,17 +692,15 @@ FixedBitmap::FixedBitmap( vcl::Window* pParent, WinBits nStyle ) :
void FixedBitmap::ImplDraw( OutputDevice* pDev, const Point& rPos, const Size& rSize )
{
Bitmap* pBitmap = &maBitmap;
// do we have a Bitmap?
if ( !(!(*pBitmap)) )
if ( !!maBitmap )
{
if ( GetStyle() & WB_SCALE )
pDev->DrawBitmap( rPos, rSize, *pBitmap );
pDev->DrawBitmapEx( rPos, rSize, maBitmap );
else
{
Point aPos = ImplCalcPos( GetStyle(), rPos, pBitmap->GetSizePixel(), rSize );
pDev->DrawBitmap( aPos, *pBitmap );
Point aPos = ImplCalcPos( GetStyle(), rPos, maBitmap.GetSizePixel(), rSize );
pDev->DrawBitmapEx( aPos, maBitmap );
}
}
}
......@@ -799,7 +797,7 @@ void FixedBitmap::DataChanged( const DataChangedEvent& rDCEvt )
}
}
void FixedBitmap::SetBitmap( const Bitmap& rBitmap )
void FixedBitmap::SetBitmap( const BitmapEx& rBitmap )
{
maBitmap = rBitmap;
CompatStateChanged( StateChangedType::Data );
......
......@@ -65,7 +65,7 @@ class MyWorkWindow : public WorkWindow
public:
Graphic maGraphic;
Bitmap *mpBitmap;
BitmapEx *mpBitmap;
VclPtr<FixedBitmap> mpFixedBitmap;
MyWorkWindow( vcl::Window* pParent, WinBits nWinStyle );
......@@ -112,10 +112,10 @@ void MyWorkWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan
aSize.setWidth( aSize.Width() * (1 + (0.1*sin(mnPaintCount/60.))) );
aSize.setHeight( aSize.Height() * (1 + (0.1*sin(mnPaintCount/50.))) );
Bitmap aEmpty;
BitmapEx aEmpty;
mpFixedBitmap->SetBitmap( aEmpty );
GraphicConversionParameters aConv( aSize );
mpBitmap = new Bitmap( maGraphic.GetBitmap( aConv ) );
mpBitmap = new BitmapEx( maGraphic.GetBitmap( aConv ) );
mpFixedBitmap->SetBitmap( *mpBitmap );
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