BitmapEx->Bitmap in various
now that Bitmap supports transparency Change-Id: If946687832cf30db70db9749e5aeed38ab1490c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190149 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
1801ac9250
commit
e6211a4b3b
@@ -238,7 +238,7 @@ void LoadImage(std::u16string_view rPreviewFile, std::shared_ptr<AdditionsItem>
|
||||
|
||||
// for VCL to be able to create bitmaps / do visual changes in the thread
|
||||
aFilter.ImportGraphic(aGraphic, aURLObj);
|
||||
BitmapEx aBmp = aGraphic.GetBitmapEx();
|
||||
Bitmap aBmp = aGraphic.GetBitmap();
|
||||
Size aBmpSize = aBmp.GetSizePixel();
|
||||
Size aThumbSize(pCurrentItem->m_xImageScreenshot->get_size_request());
|
||||
if (!aBmp.IsEmpty())
|
||||
|
||||
@@ -106,10 +106,10 @@ void CuiGraphicPreviewWindow::ScaleImageToFit()
|
||||
|
||||
if( !mpOrigGraphic->IsAnimated() )
|
||||
{
|
||||
BitmapEx aBmpEx( mpOrigGraphic->GetBitmapEx() );
|
||||
Bitmap aBmp( mpOrigGraphic->GetBitmap() );
|
||||
|
||||
if( aBmpEx.Scale( aGrfSize ) )
|
||||
maScaledOrig = aBmpEx;
|
||||
if( aBmp.Scale( aGrfSize ) )
|
||||
maScaledOrig = aBmp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,14 +208,14 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic,
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
|
||||
Bitmap aBmp( rGraphic.GetBitmap() );
|
||||
|
||||
if (BitmapFilter::Filter(aBmpEx, BitmapMosaicFilter(aSize.getWidth(), aSize.getHeight())))
|
||||
if (BitmapFilter::Filter(aBmp, BitmapMosaicFilter(aSize.getWidth(), aSize.getHeight())))
|
||||
{
|
||||
if( IsEnhanceEdges() )
|
||||
BitmapFilter::Filter(aBmpEx, BitmapSharpenFilter());
|
||||
BitmapFilter::Filter(aBmp, BitmapSharpenFilter());
|
||||
|
||||
aRet = aBmpEx;
|
||||
aRet = aBmp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,11 +252,11 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
|
||||
Bitmap aBmp( rGraphic.GetBitmap() );
|
||||
|
||||
if (BitmapFilter::Filter(aBmpEx, BitmapSmoothenFilter(nRadius)))
|
||||
if (BitmapFilter::Filter(aBmp, BitmapSmoothenFilter(nRadius)))
|
||||
{
|
||||
aRet = aBmpEx;
|
||||
aRet = aBmp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,14 +305,14 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
|
||||
Bitmap aBmp( rGraphic.GetBitmap() );
|
||||
|
||||
if (BitmapFilter::Filter(aBmpEx, BitmapSolarizeFilter(nGreyThreshold)))
|
||||
if (BitmapFilter::Filter(aBmp, BitmapSolarizeFilter(nGreyThreshold)))
|
||||
{
|
||||
if( IsInvert() )
|
||||
aBmpEx.Invert();
|
||||
aBmp.Invert();
|
||||
|
||||
aRet = aBmpEx;
|
||||
aRet = aBmp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -347,10 +347,10 @@ Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic, double,
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
|
||||
Bitmap aBmp( rGraphic.GetBitmap() );
|
||||
|
||||
if (BitmapFilter::Filter(aBmpEx, BitmapSepiaFilter(nSepiaPct)))
|
||||
aRet = aBmpEx;
|
||||
if (BitmapFilter::Filter(aBmp, BitmapSepiaFilter(nSepiaPct)))
|
||||
aRet = aBmp;
|
||||
}
|
||||
|
||||
return aRet;
|
||||
@@ -361,7 +361,7 @@ GraphicFilterPoster::GraphicFilterPoster(weld::Window* pParent, const Graphic& r
|
||||
: GraphicFilterDialog(pParent, u"cui/ui/posterdialog.ui"_ustr, u"PosterDialog"_ustr, rGraphic)
|
||||
, mxNumPoster(m_xBuilder->weld_spin_button(u"value"_ustr))
|
||||
{
|
||||
mxNumPoster->set_range(2, vcl::pixelFormatBitCount(rGraphic.GetBitmapEx().getPixelFormat()));
|
||||
mxNumPoster->set_range(2, vcl::pixelFormatBitCount(rGraphic.GetBitmap().getPixelFormat()));
|
||||
mxNumPoster->set_value(nPosterCount);
|
||||
mxNumPoster->connect_value_changed(LINK(this, GraphicFilterPoster, EditModifyHdl));
|
||||
}
|
||||
@@ -385,10 +385,10 @@ Graphic GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic, double
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
|
||||
Bitmap aBmp( rGraphic.GetBitmap() );
|
||||
|
||||
if (BitmapFilter::Filter(aBmpEx, BitmapColorQuantizationFilter(nPosterCount)))
|
||||
aRet = aBmpEx;
|
||||
if (BitmapFilter::Filter(aBmp, BitmapColorQuantizationFilter(nPosterCount)))
|
||||
aRet = aBmp;
|
||||
}
|
||||
|
||||
return aRet;
|
||||
@@ -456,10 +456,10 @@ Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic, double
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
|
||||
Bitmap aBmp( rGraphic.GetBitmap() );
|
||||
|
||||
if (BitmapFilter::Filter(aBmpEx, BitmapEmbossGreyFilter(nAzim, nElev)))
|
||||
aRet = aBmpEx;
|
||||
if (BitmapFilter::Filter(aBmp, BitmapEmbossGreyFilter(nAzim, nElev)))
|
||||
aRet = aBmp;
|
||||
}
|
||||
|
||||
return aRet;
|
||||
|
||||
@@ -241,9 +241,9 @@ void TipOfTheDayDialog::UpdateTip()
|
||||
|
||||
if (!aGraphic.IsAnimated())
|
||||
{
|
||||
BitmapEx aBmpEx(aGraphic.GetBitmapEx());
|
||||
if (aBmpEx.Scale(ThumbSize))
|
||||
aGraphic = aBmpEx;
|
||||
Bitmap aBmp(aGraphic.GetBitmap());
|
||||
if (aBmp.Scale(ThumbSize))
|
||||
aGraphic = aBmp;
|
||||
}
|
||||
m_aPreview.SetPreview(aGraphic);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ void UITabPage::UpdateImage(std::u16string_view sFileName)
|
||||
{
|
||||
ScopedVclPtr<VirtualDevice> m_pVirDev = m_pImage->create_virtual_device();
|
||||
m_pVirDev->SetOutputSizePixel(aGraphic.GetSizePixel());
|
||||
m_pVirDev->DrawBitmapEx(Point(0, 0), aGraphic.GetBitmapEx());
|
||||
m_pVirDev->DrawBitmapEx(Point(0, 0), aGraphic.GetBitmap());
|
||||
m_pImage->set_image(m_pVirDev.get());
|
||||
m_pVirDev.disposeAndClear();
|
||||
}
|
||||
|
||||
@@ -1031,7 +1031,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, ClickAddBrowseHdl_Impl, weld::Button&, voi
|
||||
Graphic aGraphic;
|
||||
GraphicConverter::Import( *pIn, aGraphic );
|
||||
|
||||
BitmapEx aBitmap = aGraphic.GetBitmapEx();
|
||||
Bitmap aBitmap = aGraphic.GetBitmap();
|
||||
tools::Long nPixelX = aBitmap.GetSizePixel().Width();
|
||||
tools::Long nPixelY = aBitmap.GetSizePixel().Height();
|
||||
double ratio = nPixelY/static_cast<double>(nPixelX);
|
||||
@@ -2036,7 +2036,7 @@ IMPL_LINK_NOARG(SvxNumOptionsTabPage, PopupActivateHdl_Impl, weld::Toggleable&,
|
||||
}
|
||||
if(GalleryExplorer::GetGraphicObj( GALLERY_THEME_BULLETS, i, &aGraphic))
|
||||
{
|
||||
BitmapEx aBitmap(aGraphic.GetBitmapEx());
|
||||
Bitmap aBitmap(aGraphic.GetBitmap());
|
||||
Size aSize(aBitmap.GetSizePixel());
|
||||
if(aSize.Width() > MAX_BMP_WIDTH ||
|
||||
aSize.Height() > MAX_BMP_HEIGHT)
|
||||
|
||||
@@ -315,8 +315,8 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
|
||||
std::unique_ptr<GraphicObject> pGraphicObject;
|
||||
pGraphicObject.reset( new GraphicObject(aItem.GetGraphicObject()) );
|
||||
|
||||
BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
|
||||
Size aTempBitmapSize = aBmpEx.GetSizePixel();
|
||||
Bitmap aBmp(pGraphicObject->GetGraphic().GetBitmap());
|
||||
Size aTempBitmapSize = aBmp.GetSizePixel();
|
||||
rBitmapSize = Application::GetDefaultDevice()->PixelToLogic(aTempBitmapSize, MapMode(MapUnit::Map100thMM));
|
||||
CalculateBitmapPresetSize();
|
||||
|
||||
@@ -541,8 +541,8 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, ValueSet*, void)
|
||||
|
||||
if(pGraphicObject)
|
||||
{
|
||||
BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
|
||||
Size aTempBitmapSize = aBmpEx.GetSizePixel();
|
||||
Bitmap aBmp(pGraphicObject->GetGraphic().GetBitmap());
|
||||
Size aTempBitmapSize = aBmp.GetSizePixel();
|
||||
const double fUIScale = mpView ? double(mpView->GetModel().GetUIScale()) : 1.0;
|
||||
Size aBitmapSize100mm = o3tl::convert(aTempBitmapSize, o3tl::Length::pt, o3tl::Length::mm100);
|
||||
|
||||
|
||||
@@ -1410,7 +1410,7 @@ void SvxLineTabPage::PopulateMenus()
|
||||
|
||||
if(pGraphic)
|
||||
{
|
||||
BitmapEx aBitmap(pGraphic->GetBitmapEx());
|
||||
Bitmap aBitmap(pGraphic->GetBitmap());
|
||||
Size aSize(aBitmap.GetSizePixel());
|
||||
if(aSize.Width() > MAX_BMP_WIDTH || aSize.Height() > MAX_BMP_HEIGHT)
|
||||
{
|
||||
|
||||
@@ -188,7 +188,7 @@ bool GraphicExportFilter::filterRenderDocument() const
|
||||
SvMemoryStream aMemStream;
|
||||
const GraphicConversionParameters aParameters(aTargetSizePixel, true, true);
|
||||
|
||||
const ErrCode nResult = rFilter.ExportGraphic( aGraphic.GetBitmapEx(aParameters), u"", aMemStream,
|
||||
const ErrCode nResult = rFilter.ExportGraphic( aGraphic.GetBitmap(aParameters), u"", aMemStream,
|
||||
nFilterFormat, &maFilterDataSequence );
|
||||
|
||||
if ( nResult == ERRCODE_NONE )
|
||||
|
||||
@@ -5620,7 +5620,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, T
|
||||
Graphic aGraf;
|
||||
if ( rManager.GetBLIP( rManager.GetPropertyValue( DFF_Prop_fillBlip, 0 ), aGraf ) )
|
||||
{
|
||||
Bitmap aBmp( aGraf.GetBitmapEx().GetBitmap() );
|
||||
Bitmap aBmp( aGraf.GetBitmap().CreateColorBitmap() );
|
||||
Size aSize( aBmp.GetSizePixel() );
|
||||
if ( aSize.Width() && aSize.Height() )
|
||||
{
|
||||
|
||||
@@ -199,7 +199,7 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter,
|
||||
{
|
||||
Graphic aGraph(aMtf);
|
||||
// use antialiasing to improve how graphic objects look
|
||||
BitmapEx bmp = aGraph.GetBitmapEx(GraphicConversionParameters(Size(0, 0), false, true, false));
|
||||
Bitmap bmp = aGraph.GetBitmap(GraphicConversionParameters(Size(0, 0), false, true, false));
|
||||
Graphic bgraph(bmp);
|
||||
aMtf = bgraph.GetGDIMetaFile();
|
||||
}
|
||||
|
||||
@@ -1569,16 +1569,16 @@ Bitmap AddonsOptions_Impl::ReadImageFromURL(const OUString& aImageURL)
|
||||
GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
|
||||
rGF.ImportGraphic( aGraphic, u"", *pStream );
|
||||
|
||||
BitmapEx aBitmapEx = aGraphic.GetBitmapEx();
|
||||
Bitmap aBitmap = aGraphic.GetBitmap();
|
||||
|
||||
Size aBmpSize = aBitmapEx.GetSizePixel();
|
||||
Size aBmpSize = aBitmap.GetSizePixel();
|
||||
if ( !aBmpSize.IsEmpty() )
|
||||
{
|
||||
// Support non-transparent bitmaps to be downward compatible with OOo 1.1.x addons
|
||||
if( !aBitmapEx.IsAlpha() )
|
||||
aBitmapEx = BitmapEx( aBitmapEx.GetBitmap(), COL_LIGHTMAGENTA );
|
||||
if( !aBitmap.HasAlpha() )
|
||||
aBitmap = Bitmap(BitmapEx( aBitmap.CreateColorBitmap(), COL_LIGHTMAGENTA ));
|
||||
|
||||
aImage = Bitmap(aBitmapEx);
|
||||
aImage = aBitmap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ static bool implts_checkAndScaleGraphic( uno::Reference< XGraphic >& rOutGraphic
|
||||
Graphic aImage(rInGraphic);
|
||||
if (BITMAP_SIZE[nImageType] != aImage.GetSizePixel())
|
||||
{
|
||||
BitmapEx aBitmap = aImage.GetBitmapEx();
|
||||
Bitmap aBitmap = aImage.GetBitmap();
|
||||
aBitmap.Scale(BITMAP_SIZE[nImageType]);
|
||||
aImage = Graphic(aBitmap);
|
||||
rOutGraphic = aImage.GetXGraphic();
|
||||
|
||||
@@ -124,17 +124,17 @@ bool ImageButtonToolbarController::ReadImageFromURL( bool bBigImage, const OUStr
|
||||
GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
|
||||
rGF.ImportGraphic( aGraphic, u"", *pStream );
|
||||
|
||||
BitmapEx aBitmapEx = aGraphic.GetBitmapEx();
|
||||
Bitmap aBitmap = aGraphic.GetBitmap();
|
||||
|
||||
const ::Size aSize = bBigImage ? aImageSizeBig : aImageSizeSmall; // Sizes used for toolbar images
|
||||
|
||||
::Size aBmpSize = aBitmapEx.GetSizePixel();
|
||||
::Size aBmpSize = aBitmap.GetSizePixel();
|
||||
if ( !aBmpSize.IsEmpty() )
|
||||
{
|
||||
::Size aNoScaleSize( aBmpSize.Width(), aSize.Height() );
|
||||
if ( aBmpSize != aNoScaleSize )
|
||||
aBitmapEx.Scale( aNoScaleSize, BmpScaleFlag::BestQuality );
|
||||
aImage = Image( aBitmapEx );
|
||||
aBitmap.Scale( aNoScaleSize, BmpScaleFlag::BestQuality );
|
||||
aImage = Image( aBitmap );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -175,17 +175,17 @@ Bitmap ThumbnailView::readThumbnail(const OUString &msURL)
|
||||
}
|
||||
|
||||
// Extract the image from the stream.
|
||||
BitmapEx aThumbnail;
|
||||
Bitmap aThumbnail;
|
||||
if (auto pStream = utl::UcbStreamHelper::CreateStream(xIStream, /*CloseStream=*/true))
|
||||
{
|
||||
Graphic aGraphic = GraphicFilter::GetGraphicFilter().ImportUnloadedGraphic(*pStream);
|
||||
aThumbnail = aGraphic.GetBitmapEx();
|
||||
aThumbnail = aGraphic.GetBitmap();
|
||||
}
|
||||
|
||||
// Note that the preview is returned without scaling it to the desired
|
||||
// width. This gives the caller the chance to take advantage of a
|
||||
// possibly larger resolution then was asked for.
|
||||
return Bitmap(aThumbnail);
|
||||
return aThumbnail;
|
||||
}
|
||||
|
||||
ThumbnailView::ThumbnailView(std::unique_ptr<weld::ScrolledWindow> xWindow, std::unique_ptr<weld::Menu> xMenu)
|
||||
|
||||
@@ -735,7 +735,7 @@ IMPL_LINK_NOARG(FileDialogHelper_Impl, TimeOutHdl_Impl, Timer *, void)
|
||||
// is responsible for placing it at its
|
||||
// proper position and painting a frame
|
||||
|
||||
BitmapEx aBmp = maGraphic.GetBitmapEx();
|
||||
Bitmap aBmp = maGraphic.GetBitmap();
|
||||
if ( !aBmp.IsEmpty() )
|
||||
{
|
||||
// scale the bitmap to the correct size
|
||||
|
||||
@@ -74,7 +74,7 @@ void SvgFeImageNode::parseAttribute(SVGToken aSVGToken, const OUString& aContent
|
||||
void SvgFeImageNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTarget,
|
||||
const SvgFilterNode* pParent) const
|
||||
{
|
||||
BitmapEx aBitmapEx;
|
||||
Bitmap aBitmap;
|
||||
|
||||
if (!maData.isEmpty())
|
||||
{
|
||||
@@ -90,7 +90,7 @@ void SvgFeImageNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTar
|
||||
if (ERRCODE_NONE
|
||||
== GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, u"", aStream))
|
||||
{
|
||||
aBitmapEx = aGraphic.GetBitmapEx();
|
||||
aBitmap = aGraphic.GetBitmap();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,20 +115,20 @@ void SvgFeImageNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTar
|
||||
if (ERRCODE_NONE
|
||||
== GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aAbsUrl, aStream))
|
||||
{
|
||||
aBitmapEx = aGraphic.GetBitmapEx();
|
||||
aBitmap = aGraphic.GetBitmap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!aBitmapEx.IsEmpty() && 0 != aBitmapEx.GetSizePixel().Width()
|
||||
&& 0 != aBitmapEx.GetSizePixel().Height())
|
||||
if (!aBitmap.IsEmpty() && 0 != aBitmap.GetSizePixel().Width()
|
||||
&& 0 != aBitmap.GetSizePixel().Height())
|
||||
{
|
||||
basegfx::B2DRange aViewBox
|
||||
= rTarget.getB2DRange(drawinglayer::geometry::ViewInformation2D());
|
||||
const drawinglayer::primitive2d::Primitive2DReference xRef(
|
||||
new drawinglayer::primitive2d::BitmapPrimitive2D(
|
||||
Bitmap(aBitmapEx), basegfx::utils::createScaleTranslateB2DHomMatrix(
|
||||
aViewBox.getRange(), aViewBox.getMinimum())));
|
||||
aBitmap, basegfx::utils::createScaleTranslateB2DHomMatrix(aViewBox.getRange(),
|
||||
aViewBox.getMinimum())));
|
||||
|
||||
rTarget = drawinglayer::primitive2d::Primitive2DContainer{ xRef };
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace svgio::svgreader
|
||||
const Graphic& rGraphic,
|
||||
drawinglayer::primitive2d::Primitive2DContainer& rEmbedded,
|
||||
basegfx::B2DRange& rViewBox,
|
||||
BitmapEx& rBitmapEx)
|
||||
Bitmap& rBitmap)
|
||||
{
|
||||
if(GraphicType::Bitmap == rGraphic.GetType())
|
||||
{
|
||||
@@ -171,13 +171,13 @@ namespace svgio::svgreader
|
||||
else
|
||||
{
|
||||
// get bitmap
|
||||
rBitmapEx = rGraphic.GetBitmapEx();
|
||||
rBitmap = rGraphic.GetBitmap();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// evtl. convert to bitmap
|
||||
rBitmapEx = rGraphic.GetBitmapEx();
|
||||
rBitmap = rGraphic.GetBitmap();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace svgio::svgreader
|
||||
if(fWidth <= 0.0 || fHeight <= 0.0)
|
||||
return;
|
||||
|
||||
BitmapEx aBitmapEx;
|
||||
Bitmap aBitmap;
|
||||
drawinglayer::primitive2d::Primitive2DContainer aNewTarget;
|
||||
|
||||
// prepare Target and ViewBox for evtl. AspectRatio mappings
|
||||
@@ -220,7 +220,7 @@ namespace svgio::svgreader
|
||||
u"",
|
||||
aStream))
|
||||
{
|
||||
extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmapEx);
|
||||
extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -247,7 +247,7 @@ namespace svgio::svgreader
|
||||
aAbsUrl,
|
||||
aStream))
|
||||
{
|
||||
extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmapEx);
|
||||
extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -266,10 +266,10 @@ namespace svgio::svgreader
|
||||
}
|
||||
}
|
||||
|
||||
if(!aBitmapEx.IsEmpty() && 0 != aBitmapEx.GetSizePixel().Width() && 0 != aBitmapEx.GetSizePixel().Height())
|
||||
if(!aBitmap.IsEmpty() && 0 != aBitmap.GetSizePixel().Width() && 0 != aBitmap.GetSizePixel().Height())
|
||||
{
|
||||
// calculate centered unit size
|
||||
const double fAspectRatio = static_cast<double>(aBitmapEx.GetSizePixel().Width()) / static_cast<double>(aBitmapEx.GetSizePixel().Height());
|
||||
const double fAspectRatio = static_cast<double>(aBitmap.GetSizePixel().Width()) / static_cast<double>(aBitmap.GetSizePixel().Height());
|
||||
|
||||
if (basegfx::fTools::equalZero(fAspectRatio))
|
||||
{
|
||||
@@ -301,7 +301,7 @@ namespace svgio::svgreader
|
||||
// as transformation to map the picture data correctly
|
||||
aNewTarget.resize(1);
|
||||
aNewTarget[0] = new drawinglayer::primitive2d::BitmapPrimitive2D(
|
||||
Bitmap(aBitmapEx),
|
||||
aBitmap,
|
||||
basegfx::utils::createScaleTranslateB2DHomMatrix(
|
||||
aViewBox.getRange(),
|
||||
aViewBox.getMinimum()));
|
||||
|
||||
@@ -461,10 +461,10 @@ void ExportDialog::GetGraphicStream()
|
||||
( ( maSize.Width != aSizePixel.Width() ) ||
|
||||
( maSize.Height != aSizePixel.Height() ) ) )
|
||||
{
|
||||
BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
|
||||
Bitmap aBmp( aGraphic.GetBitmap() );
|
||||
// export: use highest quality
|
||||
aBmpEx.Scale( Size( maSize.Width, maSize.Height ), BmpScaleFlag::Lanczos );
|
||||
aGraphic = aBmpEx;
|
||||
aBmp.Scale( Size( maSize.Width, maSize.Height ), BmpScaleFlag::Lanczos );
|
||||
aGraphic = aBmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -310,10 +310,10 @@ OUString GraphicHelper::ExportGraphic(weld::Window* pParent, const Graphic& rGra
|
||||
( ( nWidth != aSizePixel.Width() ) ||
|
||||
( nHeight != aSizePixel.Height() ) ) )
|
||||
{
|
||||
BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
|
||||
Bitmap aBmp( aGraphic.GetBitmap() );
|
||||
// export: use highest quality
|
||||
aBmpEx.Scale( Size( nWidth, nHeight ), BmpScaleFlag::Lanczos );
|
||||
aGraphic = aBmpEx;
|
||||
aBmp.Scale( Size( nWidth, nHeight ), BmpScaleFlag::Lanczos );
|
||||
aGraphic = aBmp;
|
||||
}
|
||||
|
||||
XOutBitmap::WriteGraphic( aGraphic, sPath, aFilter,
|
||||
|
||||
@@ -726,7 +726,7 @@ namespace drawinglayer::primitive2d
|
||||
// if there is no logical size, create a size from pixel size and set MapMode accordingly
|
||||
if(GraphicType::Bitmap == aGraphic.GetType())
|
||||
{
|
||||
aGraphic.SetPrefSize(aGraphic.GetBitmapEx().GetSizePixel());
|
||||
aGraphic.SetPrefSize(aGraphic.GetBitmap().GetSizePixel());
|
||||
aGraphic.SetPrefMapMode(MapMode(MapUnit::MapPixel));
|
||||
aPrefSize = aGraphic.GetPrefSize();
|
||||
}
|
||||
|
||||
@@ -528,11 +528,11 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj1, bool bScale)
|
||||
}
|
||||
else
|
||||
{
|
||||
BitmapEx aBitmapEx;
|
||||
Bitmap aBitmap;
|
||||
|
||||
if(pSdrGrafObj)
|
||||
{
|
||||
aBitmapEx = pSdrGrafObj->GetGraphic().GetBitmapEx();
|
||||
aBitmap = pSdrGrafObj->GetGraphic().GetBitmap();
|
||||
}
|
||||
|
||||
pObj.clear();
|
||||
@@ -558,11 +558,11 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj1, bool bScale)
|
||||
pObj->SetLayer(aOldLayer);
|
||||
pObj->SetMergedItemSet(aOldItemSet);
|
||||
|
||||
if(!aBitmapEx.IsEmpty())
|
||||
if(!aBitmap.IsEmpty())
|
||||
{
|
||||
// aNewRange is inside of aOldRange and defines which part of aBitmapEx is used
|
||||
const double fScaleX(aBitmapEx.GetSizePixel().Width() / (aOldRange.getWidth() ? aOldRange.getWidth() : 1.0));
|
||||
const double fScaleY(aBitmapEx.GetSizePixel().Height() / (aOldRange.getHeight() ? aOldRange.getHeight() : 1.0));
|
||||
const double fScaleX(aBitmap.GetSizePixel().Width() / (aOldRange.getWidth() ? aOldRange.getWidth() : 1.0));
|
||||
const double fScaleY(aBitmap.GetSizePixel().Height() / (aOldRange.getHeight() ? aOldRange.getHeight() : 1.0));
|
||||
basegfx::B2DRange aPixel(aNewRange);
|
||||
basegfx::B2DHomMatrix aTrans;
|
||||
|
||||
@@ -570,7 +570,7 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj1, bool bScale)
|
||||
aTrans.scale(fScaleX, fScaleY);
|
||||
aPixel.transform(aTrans);
|
||||
|
||||
const Size aOrigSizePixel(aBitmapEx.GetSizePixel());
|
||||
const Size aOrigSizePixel(aBitmap.GetSizePixel());
|
||||
const Point aClipTopLeft(
|
||||
basegfx::fround<tools::Long>(floor(std::max(0.0, aPixel.getMinX()))),
|
||||
basegfx::fround<tools::Long>(floor(std::max(0.0, aPixel.getMinY()))));
|
||||
@@ -578,7 +578,7 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj1, bool bScale)
|
||||
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(
|
||||
aBitmapEx,
|
||||
BitmapEx(aBitmap),
|
||||
aClipTopLeft,
|
||||
aClipSize);
|
||||
|
||||
|
||||
@@ -2325,7 +2325,7 @@ void SAL_CALL VCLXDialog::setProperty(
|
||||
{
|
||||
Graphic aImage(xGraphic);
|
||||
|
||||
Wallpaper aWallpaper(aImage.GetBitmapEx());
|
||||
Wallpaper aWallpaper(aImage.GetBitmap());
|
||||
aWallpaper.SetStyle( WallpaperStyle::Scale );
|
||||
pDialog->SetBackground( aWallpaper );
|
||||
}
|
||||
@@ -2460,7 +2460,7 @@ void SAL_CALL VCLXMultiPage::setProperty(
|
||||
{
|
||||
Graphic aImage(xGraphic);
|
||||
|
||||
Wallpaper aWallpaper(aImage.GetBitmapEx());
|
||||
Wallpaper aWallpaper(aImage.GetBitmap());
|
||||
aWallpaper.SetStyle( WallpaperStyle::Scale );
|
||||
pTabControl->SetBackground( aWallpaper );
|
||||
}
|
||||
@@ -2670,7 +2670,7 @@ void SAL_CALL VCLXTabPage::setProperty(
|
||||
{
|
||||
Graphic aImage(xGraphic);
|
||||
|
||||
Wallpaper aWallpaper(aImage.GetBitmapEx());
|
||||
Wallpaper aWallpaper(aImage.GetBitmap());
|
||||
aWallpaper.SetStyle( WallpaperStyle::Scale );
|
||||
pTabPage->SetBackground( aWallpaper );
|
||||
}
|
||||
|
||||
@@ -1392,7 +1392,7 @@ bool TreeControlPeer::loadImage( const OUString& rURL, Image& rImage )
|
||||
Reference< XGraphic > xGraphic( mxGraphicProvider->queryGraphic( aProps ) );
|
||||
|
||||
Graphic aGraphic( xGraphic );
|
||||
rImage = Image(aGraphic.GetBitmapEx());
|
||||
rImage = Image(aGraphic.GetBitmap());
|
||||
return true;
|
||||
}
|
||||
catch( Exception& )
|
||||
|
||||
Reference in New Issue
Block a user