43 maSize(rBitmap->GetWidth(),rBitmap->GetHeight()),
61 mpBitmap = std::make_shared<Gdiplus::Bitmap>(
64 PixelFormat32bppARGB);
68 mpBitmap = std::make_shared<Gdiplus::Bitmap>(
98 const geometry::IntegerRectangle2D& rect )
100 uno::Sequence< sal_Int8 > aRes( (rect.X2-rect.X1)*(rect.Y2-rect.Y1)*4 );
108 aBmpData.PixelFormat = PixelFormat32bppARGB;
114 if( Gdiplus::Ok !=
mpBitmap->LockBits( &aRect,
115 Gdiplus::ImageLockModeRead | Gdiplus::ImageLockModeUserInputBuf,
116 PixelFormat32bppARGB,
123 return uno::Sequence< sal_Int8 >();
132 const rendering::IntegerBitmapLayout& ,
133 const geometry::IntegerRectangle2D& rect )
141 aBmpData.PixelFormat = PixelFormat32bppARGB;
149 if( Gdiplus::Ok !=
mpBitmap->LockBits( &aRect,
150 Gdiplus::ImageLockModeWrite | Gdiplus::ImageLockModeUserInputBuf,
151 PixelFormat32bppARGB,
157 throw uno::RuntimeException(
"Internal error while writing BitmapData into Bitmap");
165 const rendering::IntegerBitmapLayout& ,
166 const geometry::IntegerPoint2D& pos )
171 "CanvasHelper::setPixel: X coordinate out of bounds" );
173 "CanvasHelper::setPixel: Y coordinate out of bounds" );
175 "CanvasHelper::setPixel: not enough color components" );
180 throw uno::RuntimeException(
"SetPixel called with invalid x,y points or color");
185 const geometry::IntegerPoint2D& pos )
190 "CanvasHelper::getPixel: X coordinate out of bounds" );
192 "CanvasHelper::getPixel: Y coordinate out of bounds" );
194 Gdiplus::Color aColor;
197 return uno::Sequence< sal_Int8 >();
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
css::uno::Sequence< sal_Int8 > getPixel(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos) override
void setPixel(const css::uno::Sequence< sal_Int8 > &color, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerPoint2D &pos) override
virtual GraphicsSharedPtr getGraphics() override
void setData(const css::uno::Sequence< sal_Int8 > &data, const css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect) override
virtual bool hasAlpha() const override
virtual ::basegfx::B2ISize getSize() const override
GraphicsSharedPtr mpGraphics
css::uno::Sequence< sal_Int8 > getData(css::rendering::IntegerBitmapLayout &bitmapLayout, const css::geometry::IntegerRectangle2D &rect) override
DXBitmap(const BitmapSharedPtr &rBitmap, bool bWithAlpha)
virtual BitmapSharedPtr getBitmap() const override
::basegfx::B2ISize maSize
#define ENSURE_ARG_OR_THROW(c, m)
::basegfx::B2ISize maSize
GraphicsSharedPtr mpGraphics
Gdiplus::BitmapData aBmpData
std::shared_ptr< Gdiplus::Graphics > GraphicsSharedPtr
std::shared_ptr< Gdiplus::Bitmap > BitmapSharedPtr