mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
49 lines
939 B
C++
49 lines
939 B
C++
#include "PieCtrl.h"
|
|
|
|
|
|
PieCtrl::PieCtrl() : copyRatio(1) {
|
|
Transparent();
|
|
BackPaint();
|
|
}
|
|
|
|
#ifdef PLATFORM_WIN32
|
|
|
|
void PieCtrl::SaveAsMetafile(const char* file)
|
|
{
|
|
GuiLock __;
|
|
WinMetaFileDraw wmfd;
|
|
wmfd.Create(copyRatio*GetSize().cx, copyRatio*GetSize().cy, "Pie", "PieChart", file);
|
|
PaintPie(wmfd, copyRatio);
|
|
wmfd.Close();
|
|
}
|
|
|
|
void PieCtrl::SaveToClipboard(bool saveAsMetafile)
|
|
{
|
|
GuiLock __;
|
|
if (saveAsMetafile) {
|
|
WinMetaFileDraw wmfd;
|
|
wmfd.Create(copyRatio*GetSize().cx, copyRatio*GetSize().cy, "ScatterCtrl", "chart");
|
|
PaintPie(wmfd, copyRatio);
|
|
WinMetaFile wmf = wmfd.Close();
|
|
wmf.WriteClipboard();
|
|
} else {
|
|
Image img = GetImage(copyRatio);
|
|
WriteClipboardImage(img);
|
|
}
|
|
}
|
|
|
|
#else
|
|
|
|
void PieCtrl::SaveToClipboard(bool)
|
|
{
|
|
GuiLock __;
|
|
Image img = GetImage(copyRatio);
|
|
WriteClipboardImage(img);
|
|
}
|
|
|
|
#endif
|
|
|
|
void PieCtrl::Paint(Draw& w)
|
|
{
|
|
PaintPie(w, 1);
|
|
}
|