1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
11 #include <test/outputdevice.hxx>
12 #include <vcl/gradient.hxx>
17 Bitmap
OutputDeviceTestGradient::setupLinearGradient()
19 initialSetup(12, 12, constBackgroundColor
);
21 Gradient
aGradient(GradientStyle::Linear
, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
22 aGradient
.SetAngle(900);
23 tools::Rectangle
aDrawRect(maVDRectangle
.Left() + 1, maVDRectangle
.Top() + 1,
24 maVDRectangle
.Right() - 1, maVDRectangle
.Bottom() - 1);
25 mpVirtualDevice
->DrawGradient(aDrawRect
, aGradient
);
27 return mpVirtualDevice
->GetBitmap(maVDRectangle
.TopLeft(), maVDRectangle
.GetSize());
30 Bitmap
OutputDeviceTestGradient::setupRadialGradient()
32 initialSetup(12, 12, constBackgroundColor
);
34 Gradient
aGradient(GradientStyle::Radial
, Color(0xFF, 0xFF, 0xFF), Color(0x00, 0x00, 0x00));
35 tools::Rectangle
aDrawRect(maVDRectangle
.Left() + 1, maVDRectangle
.Top() + 1,
36 maVDRectangle
.Right() - 1, maVDRectangle
.Bottom() - 1);
37 mpVirtualDevice
->DrawGradient(aDrawRect
, aGradient
);
39 return mpVirtualDevice
->GetBitmap(maVDRectangle
.TopLeft(), maVDRectangle
.GetSize());
42 }} // end namespace vcl::test
44 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */