mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Add DPI export targets
This commit is contained in:
@@ -96,7 +96,7 @@ Bitmap export_bitmap(const SetP& set, const vector<CardP>& cards, bool scale_to_
|
||||
Image export_image(const SetP& set, const CardP& card, const double zoom = 1.0, const Radians angle_radians = 0.0);
|
||||
Image export_image(const SetP& set, const vector<CardP>& cards, bool scale_to_lowest_dpi = false, int padding = 0, const double zoom = 1.0, const Radians angle_radians = 0.0);
|
||||
|
||||
/// Export the image of one or more cards to a given filename
|
||||
/// Export the image of one or more cards to a given filename, using the app's zoom and rotation settings
|
||||
void export_image(const SetP& set, const CardP& card, const String& filename);
|
||||
void export_image(const SetP& set, const vector<CardP>& cards, const String& path, const String& filename_template, FilenameConflicts conflicts);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ Rotation UnzoomedDataViewer::getRotation() const {
|
||||
return Rotation(angle, stylesheet->getCardRect(), zoom, 1.0, ROTATION_ATTACH_TOP_LEFT);
|
||||
}
|
||||
|
||||
double export_zoom = settings.stylesheetSettingsFor(set->stylesheetFor(card)).export_zoom();
|
||||
double export_zoom = settings.exportZoomSettingsFor(set->stylesheetFor(card));
|
||||
bool use_viewer_rotation = !settings.stylesheetSettingsFor(set->stylesheetFor(card)).card_normal_export();
|
||||
|
||||
if (use_viewer_rotation) {
|
||||
@@ -195,10 +195,13 @@ Image export_image(const SetP& set, const vector<CardP>& cards, bool scale_to_lo
|
||||
return img;
|
||||
}
|
||||
|
||||
void export_image(const SetP& set, const CardP& card, const String& filename) {
|
||||
Image img = export_image(set, card);
|
||||
img.SaveFile(filename); // can't use Bitmap::saveFile, it wants to know the file type
|
||||
// but image.saveFile determines it automagicly
|
||||
void export_image(const SetP& set, const CardP& card, const String& filename) {
|
||||
const StyleSheet& stylesheet = set->stylesheetFor(card);
|
||||
StyleSheetSettings& stylesheet_settings = settings.stylesheetSettingsFor(stylesheet);
|
||||
double zoom = settings.exportZoomSettingsFor(stylesheet);
|
||||
Radians angle = stylesheet_settings.card_normal_export() ? 0.0 : stylesheet_settings.card_angle() / 360.0 * 2.0 * M_PI;
|
||||
Image img = export_image(set, card, zoom, angle);
|
||||
img.SaveFile(filename);
|
||||
}
|
||||
|
||||
void export_image(const SetP& set, const vector<CardP>& cards,
|
||||
|
||||
Reference in New Issue
Block a user