void HandleFieldButtonPressEvent(object o, Gtk.ButtonPressEventArgs args) { LongoMatch.Core.Common.Image background; Gdk.Pixbuf pix = Helpers.Misc.OpenImage(this); if (pix == null) { return; } background = new Image(pix); background.ScaleInplace(Constants.MAX_BACKGROUND_WIDTH, Constants.MAX_BACKGROUND_HEIGHT); if (o == fieldeventbox) { UpdateBackground(background, 0); } else if (o == hfieldeventbox) { UpdateBackground(background, 1); } else if (o == goaleventbox) { UpdateBackground(background, 2); } 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; } }
void HandlePlayerButtonPressEvent(object o, ButtonPressEventArgs args) { Image player; Pixbuf pix = Helpers.Misc.OpenImage(this); if (pix == null) { return; } player = new Image(pix); player.ScaleInplace(Constants.MAX_PLAYER_ICON_SIZE, Constants.MAX_PLAYER_ICON_SIZE); if (player != null && loadedPlayer != null) { playerimage.Pixbuf = player.Value; loadedPlayer.Photo = player; teamtagger.Reload(); 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 HandleFieldButtonPressEvent(object o, Gtk.ButtonPressEventArgs args) { LongoMatch.Core.Common.Image background; Gdk.Pixbuf pix = Helpers.Misc.OpenImage (this); if (pix == null) { return; } background = new Image (pix); background.ScaleInplace (Constants.MAX_BACKGROUND_WIDTH, Constants.MAX_BACKGROUND_HEIGHT); if (o == fieldeventbox) { UpdateBackground (background, 0); } else if (o == hfieldeventbox) { UpdateBackground (background, 1); } else if (o == goaleventbox) { UpdateBackground (background, 2); } 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; } }
void HandlePlayerButtonPressEvent(object o, ButtonPressEventArgs args) { Image player; Pixbuf pix = Helpers.Misc.OpenImage (this); if (pix == null) { return; } player = new Image (pix); player.ScaleInplace (Constants.MAX_PLAYER_ICON_SIZE, Constants.MAX_PLAYER_ICON_SIZE); if (player != null && loadedPlayer != null) { playerimage.Pixbuf = player.Value; loadedPlayer.Photo = player; teamtagger.Reload (); Edited = true; } }