ScaleInplace() public method

public ScaleInplace ( ) : void
return void
コード例 #1
0
ファイル: DashboardWidget.cs プロジェクト: kuggaa/longomatch
        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;
        }
コード例 #2
0
        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;
            }
        }
コード例 #3
0
        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;
            }
        }
コード例 #4
0
ファイル: TestImage.cs プロジェクト: GNOME/longomatch
        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);
        }
コード例 #5
0
ファイル: DashboardWidget.cs プロジェクト: GNOME/longomatch
        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;
        }
コード例 #6
0
        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;
            }
        }
コード例 #7
0
        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;
            }
        }