[f-spot] Print more pictures
- From: Stephane Delcroix <sdelcroix src gnome org>
- To: svn-commits-list gnome org
- Subject: [f-spot] Print more pictures
- Date: Thu, 18 Jun 2009 08:27:29 -0400 (EDT)
commit eeabfe2660818e43ed5579791a14da2217f0565e
Author: Vincent Pomey <vpomey free fr>
Date: Thu Jun 18 14:18:49 2009 +0200
Print more pictures
Patch 136340 for bgo 555377 from Vincent Pomey
src/PrintOperation.cs | 8 +++++++-
src/Widgets/CustomPrintWidget.cs | 30 +++++++++++++++---------------
2 files changed, 22 insertions(+), 16 deletions(-)
---
diff --git a/src/PrintOperation.cs b/src/PrintOperation.cs
index a64dea0..1dfbe4b 100644
--- a/src/PrintOperation.cs
+++ b/src/PrintOperation.cs
@@ -88,6 +88,9 @@ namespace FSpot
case 2: ppx = 1; ppy = 2; break;
case 4: ppx = ppy = 2; break;
case 9: ppx = ppy = 3; break;
+ case 12: ppx = 3; ppy = 4; break;
+ case 20: ppx = 4; ppy = 5; break;
+ case 30: ppx = 5; ppy = 6; break;
}
//FIXME: if paper is landscape, swap ppx with ppy
@@ -95,6 +98,9 @@ namespace FSpot
double w = context.Width / ppx;
double h = context.Height / ppy;
+ // compute picture size using 4800DPI
+ double mx=(w / 25.4) * 4800, my=(h / 25.4) * 4800;
+
for (int x = 0; x <= ppx; x++) {
for (int y = 0; y <= ppy; y++) {
int p_index = repeat ? page_nr : page_nr * photos_per_page + y * ppx + x;
@@ -106,7 +112,7 @@ namespace FSpot
{
Gdk.Pixbuf pixbuf;
try {
- pixbuf = img.Load ();
+ pixbuf = img.Load ((int) mx, (int) my);
FSpot.ColorManagement.ApplyPrinterProfile (pixbuf, img.GetProfile ());
} catch (Exception e) {
Log.Exception ("Unable to load image " + selected_photos[p_index].DefaultVersionUri + "\n", e);
diff --git a/src/Widgets/CustomPrintWidget.cs b/src/Widgets/CustomPrintWidget.cs
index 390a8a2..99fc2b0 100644
--- a/src/Widgets/CustomPrintWidget.cs
+++ b/src/Widgets/CustomPrintWidget.cs
@@ -27,7 +27,7 @@ namespace FSpot.Widgets
Gtk.Image preview_image;
CheckButton fullpage;
- RadioButton ppp1, ppp2, ppp4, ppp9;
+ RadioButton ppp1, ppp2, ppp4, ppp9, ppp20, ppp30;
RadioButton zoom, fill, scaled;
CheckButton repeat, white_border, crop_marks;
@@ -66,6 +66,8 @@ namespace FSpot.Widgets
else if (ppp2.Active) return 2;
else if (ppp4.Active) return 4;
else if (ppp9.Active) return 9;
+ else if (ppp20.Active) return 20;
+ else if (ppp30.Active) return 30;
else
throw new Exception ("Something is wrong on this GUI");
}
@@ -121,24 +123,22 @@ namespace FSpot.Widgets
VBox right_vb = new VBox ();
right_vb.PackStart (page_size, true, true, 0);
- Frame ppp_frame = new Frame (Catalog.GetString ("Photos per page"));
- vb = new VBox ();
+ Frame tbl_frame = new Frame (Catalog.GetString ("Photos per page"));
+ Table tbl = new Table (2, 7, false);
- vb.PackStart (ppp1 = new RadioButton ("1"), false, false, 0);
- vb.PackStart (ppp2 = new RadioButton (ppp1, "2"), false, false, 0);
- vb.PackStart (ppp4 = new RadioButton (ppp1, "4"), false, false, 0);
- vb.PackStart (ppp9 = new RadioButton (ppp1, "9"), false, false, 0);
-// ppp1.Toggled += TriggerChanged;
-// ppp2.Toggled += TriggerChanged;
-// ppp4.Toggled += TriggerChanged;
-// ppp9.Toggled += TriggerChanged;
+ tbl.Attach (ppp1 = new RadioButton ("1"), 0, 1, 1, 2);
+ tbl.Attach (ppp2 = new RadioButton (ppp1, "2"), 0, 1, 2, 3);
+ tbl.Attach (ppp4 = new RadioButton (ppp1, "2 x 2"), 0, 1, 3, 4);
+ tbl.Attach (ppp9 = new RadioButton (ppp1, "3 x 3"), 0, 1, 4, 5);
+ tbl.Attach (ppp20 = new RadioButton (ppp1, "4 x 5"), 0, 1, 5, 6);
+ tbl.Attach (ppp30 = new RadioButton (ppp1, "5 x 6"), 0, 1, 6, 7);
- vb.PackStart (repeat = new CheckButton (Catalog.GetString ("Repeat")), false, false, 0);
- vb.PackStart (crop_marks = new CheckButton (Catalog.GetString ("Print cut marks")), false, false, 0);
+ tbl.Attach (repeat = new CheckButton (Catalog.GetString ("Repeat")), 1, 2, 0, 1);
+ tbl.Attach (crop_marks = new CheckButton (Catalog.GetString ("Print cut marks")), 1, 2, 1, 2);
// crop_marks.Toggled += TriggerChanged;
- ppp_frame.Child = vb;
- right_vb.PackStart (ppp_frame, true, true, 0);
+ tbl_frame.Child = tbl;
+ right_vb.PackStart (tbl_frame, true, true, 0);
upper.PackStart (right_vb, true, true, 0);
this.PackStart (upper, true, true, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]