Skip to content

Commit e2779fa

Browse files
author
Noel Grandin
committed
BitmapEx->Bitmap in ScanPreview
now that Bitmap supports transparency Change-Id: Ife87834ff043b79de27a1936869067135710a0e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190462 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
1 parent 0a49b03 commit e2779fa

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

extensions/source/scanner/grid.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ class GridWindow : public weld::CustomWidgetController
5555
return (maPos.X() < rComp.maPos.X());
5656
}
5757

58-
void draw(vcl::RenderContext& rRenderContext, const BitmapEx& rBitmapEx)
58+
void draw(vcl::RenderContext& rRenderContext, const Bitmap& rBitmap)
5959
{
6060
const Point aOffset(rRenderContext.PixelToLogic(Point(mnOffX, mnOffY)));
61-
rRenderContext.DrawBitmapEx(maPos - aOffset, rBitmapEx);
61+
rRenderContext.DrawBitmapEx(maPos - aOffset, rBitmap);
6262
}
6363

6464
bool isHit(OutputDevice const & rWin, const Point& rPos)
@@ -97,7 +97,7 @@ class GridWindow : public weld::CustomWidgetController
9797
Handles m_aHandles;
9898
Handles::size_type m_nDragIndex;
9999

100-
BitmapEx m_aMarkerBitmap;
100+
Bitmap m_aMarkerBitmap;
101101

102102
Point transform( double x, double y );
103103
void transform( const Point& rOriginal, double& x, double& y );
@@ -126,7 +126,7 @@ class GridWindow : public weld::CustomWidgetController
126126
void drawLine(vcl::RenderContext& rRenderContext, double x1, double y1, double x2, double y2);
127127
public:
128128
GridWindow();
129-
void Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const BitmapEx &rMarkerBitmap);
129+
void Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const Bitmap &rMarkerBitmap);
130130
virtual ~GridWindow() override;
131131

132132
void setBoundings( double fMinX, double fMinY, double fMaxX, double fMaxY );
@@ -158,7 +158,7 @@ GridWindow::GridWindow()
158158
{
159159
}
160160

161-
void GridWindow::Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const BitmapEx &rMarkerBitmap)
161+
void GridWindow::Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const Bitmap &rMarkerBitmap)
162162
{
163163
m_aMarkerBitmap = rMarkerBitmap;
164164
m_pXValues = pXValues;
@@ -211,7 +211,7 @@ GridDialog::GridDialog(weld::Window* pParent, double* pXValues, double* pYValues
211211
, m_xGridWindow(new GridWindow)
212212
, m_xGridWindowWND(new weld::CustomWeld(*m_xBuilder, u"gridwindow"_ustr, *m_xGridWindow))
213213
{
214-
m_xGridWindow->Init(pXValues, pYValues, nValues, true/*bCutValues*/, BitmapEx(Bitmap(RID_SCANNER_HANDLE)));
214+
m_xGridWindow->Init(pXValues, pYValues, nValues, true/*bCutValues*/, Bitmap(RID_SCANNER_HANDLE));
215215
m_xResetTypeBox->set_active(0);
216216
m_xResetButton->connect_clicked( LINK( this, GridDialog, ClickButtonHdl ) );
217217
}

extensions/source/scanner/sanedlg.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class ScanPreview : public weld::CustomWidgetController
100100
enum DragDirection { TopLeft, Top, TopRight, Right, BottomRight, Bottom,
101101
BottomLeft, Left };
102102

103-
BitmapEx maPreviewBitmapEx;
103+
Bitmap maPreviewBitmap;
104104
tools::Rectangle maPreviewRect;
105105
Point maTopLeft, maBottomRight;
106106
Point maMinTopLeft, maMaxBottomRight;
@@ -206,7 +206,7 @@ class ScanPreview : public weld::CustomWidgetController
206206
void UpdatePreviewBounds();
207207
void SetBitmap(SvStream &rStream)
208208
{
209-
ReadDIBBitmapEx(maPreviewBitmapEx, rStream, true);
209+
ReadDIBBitmapEx(maPreviewBitmap, rStream, true);
210210
}
211211
virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override
212212
{
@@ -917,7 +917,7 @@ void ScanPreview::UpdatePreviewBounds()
917917
}
918918
else
919919
{
920-
Size aBMSize( maPreviewBitmapEx.GetSizePixel() );
920+
Size aBMSize( maPreviewBitmap.GetSizePixel() );
921921
if( aBMSize.Width() > aBMSize.Height() && aBMSize.Width() )
922922
{
923923
int nVHeight = (maBottomRight.X() - maTopLeft.X()) * aBMSize.Height() / aBMSize.Width();
@@ -944,7 +944,7 @@ void ScanPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang
944944
Size(PREVIEW_WIDTH, PREVIEW_HEIGHT)));
945945
rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
946946
// check for sane values
947-
rRenderContext.DrawBitmapEx(maPreviewRect.TopLeft(), maPreviewRect.GetSize(), maPreviewBitmapEx);
947+
rRenderContext.DrawBitmapEx(maPreviewRect.TopLeft(), maPreviewRect.GetSize(), maPreviewBitmap);
948948

949949
DrawDrag(rRenderContext);
950950
}

0 commit comments

Comments
 (0)