1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <vcl/virdev.hxx>
11 #include <ImageViewerDialog.hxx>
13 ImageViewerDialog::ImageViewerDialog(weld::Dialog
* pParent
, BitmapEx aBitmap
, OUString atitle
)
14 : GenericDialogController(pParent
, "cui/ui/imageviewer.ui", "ImageViewerDialog")
15 , m_xDisplayImage(m_xBuilder
->weld_image("ImgVW_mainImage"))
17 m_xDialog
->set_title(atitle
);
18 aBitmap
.Scale(Size(300, 300), BmpScaleFlag::Fast
);
19 ScopedVclPtr
<VirtualDevice
> m_pVirDev
= m_xDisplayImage
->create_virtual_device();
20 m_pVirDev
->SetOutputSizePixel(aBitmap
.GetSizePixel());
21 m_pVirDev
->DrawBitmapEx(Point(0, 0), aBitmap
);
22 m_xDisplayImage
->set_image(m_pVirDev
.get());
23 m_pVirDev
.disposeAndClear();