private Scale ( Gdk.Pixbuf pix, int maxWidth, int maxHeight ) : Gdk.Pixbuf | ||
pix | Gdk.Pixbuf | |
maxWidth | int | |
maxHeight | int | |
리턴 | Gdk.Pixbuf |
void UpdateBackground(Image background, int index) { if (index == 0) { template.FieldBackground = background; fieldimage.Pixbuf = background.Scale(50, 50).Value; } else if (index == 1) { template.HalfFieldBackground = background; hfieldimage.Pixbuf = background.Scale(50, 50).Value; } else if (index == 2) { template.GoalBackground = background; goalimage.Pixbuf = background.Scale(50, 50).Value; } Edited = true; }
void HandleShieldButtonPressEvent(object o, ButtonPressEventArgs args) { Image shield; Pixbuf pix = Helpers.Misc.OpenImage(this); if (pix == null) { return; } shield = new Image(pix); if (shield != null) { shield.ScaleInplace(Constants.MAX_SHIELD_ICON_SIZE, Constants.MAX_SHIELD_ICON_SIZE); template.Shield = shield; shieldimage.Pixbuf = shield.Scale(SHIELD_SIZE, SHIELD_SIZE).Value; Edited = true; } }
public void TestScale() { Image img2 = img.Scale (20, 20); Assert.AreNotSame (img, img2); Assert.AreEqual (img2.Width, 20); Assert.AreEqual (img2.Height, 20); img = img.Scale (20, 30); Assert.AreEqual (img.Width, 20); Assert.AreEqual (img.Height, 20); img = img.Scale (25, 20); Assert.AreEqual (img.Width, 20); Assert.AreEqual (img.Height, 20); img.ScaleInplace (); Assert.AreEqual (img.Width, Constants.MAX_THUMBNAIL_SIZE); Assert.AreEqual (img.Height, Constants.MAX_THUMBNAIL_SIZE); }
void UpdateBackground(Image background, int index) { if (index == 0) { template.FieldBackground = background; fieldimage.Pixbuf = background.Scale (50, 50).Value; } else if (index == 1) { template.HalfFieldBackground = background; hfieldimage.Pixbuf = background.Scale (50, 50).Value; } else if (index == 2) { template.GoalBackground = background; goalimage.Pixbuf = background.Scale (50, 50).Value; } Edited = true; }
void HandleShieldButtonPressEvent(object o, ButtonPressEventArgs args) { Image shield; Pixbuf pix = Helpers.Misc.OpenImage (this); if (pix == null) { return; } shield = new Image (pix); if (shield != null) { shield.ScaleInplace (Constants.MAX_SHIELD_ICON_SIZE, Constants.MAX_SHIELD_ICON_SIZE); template.Shield = shield; shieldimage.Pixbuf = shield.Scale (SHIELD_SIZE, SHIELD_SIZE).Value; Edited = true; } }