50{
51 wxAutoBufferedPaintDC dc(this);
52 std::unique_ptr<wxGraphicsContext> gc(wxGraphicsContext::Create(dc));
53
54 gc->SetInterpolationQuality(wxINTERPOLATION_BEST);
55
56 const wxSize
size = GetSize();
57
58 gc->SetBrush(wxBrush(GetBackgroundColour()));
59 gc->DrawRectangle(0, 0,
size.x,
size.y);
60
62 {
63 gc->SetBrush(wxBrush(wxColour(255, 255, 255, 255)));
64 gc->DrawEllipse(0, 0,
size.x,
size.y);
65 }
66 else
67 {
70
71 gc->DrawBitmap(
73 (
size.x - resultingImageSize.x) / 2,
74 (
size.y - resultingImageSize.y) / 2,
75 resultingImageSize.x,
76 resultingImageSize.y);
77
78 auto path = gc->CreatePath();
79
80 path.MoveToPoint(0, 0);
81 path.AddLineToPoint(
size.x / 2, 0);
83 path.CloseSubpath();
84
85 path.MoveToPoint(
size.x, 0);
86 path.AddLineToPoint(
size.x,
size.y / 2);
88 path.CloseSubpath();
89
91 path.AddLineToPoint(
size.x / 2,
size.y);
93 path.CloseSubpath();
94
95 path.MoveToPoint(0,
size.y);
96 path.AddLineToPoint(0,
size.y / 2);
98 path.CloseSubpath();
99
100 gc->DrawPath(path);
101 }
102}