GetImage() public method

Get the image of the current outfit
public GetImage ( ) : Image
return Image
コード例 #1
0
ファイル: Outfiter.cs プロジェクト: umdez/Tibialyzer
        public void RefreshImage()
        {
            Image oldImage = outfiterImageBox.Image;

            outfiterImageBox.Image = outfit.GetImage();
            if (oldImage != null)
            {
                oldImage.Dispose();
            }
            outfiterCode.Text = outfit.ToString();
        }
コード例 #2
0
ファイル: OutfiterForm.cs プロジェクト: umdez/Tibialyzer
        public void RefreshImage()
        {
            Image oldImage = outfiterImageBox.Image;

            outfiterImageBox.Image = outfit.GetImage();
            if (oldImage != null)
            {
                oldImage.Dispose();
            }
        }
コード例 #3
0
        private void outfiterButton_Click(object sender, EventArgs e)
        {
            int    index = nameListBox.SelectedIndex;
            string code  = outfiterCode.Text;

            SettingsManager.setSetting("HealthListImage" + index.ToString(), code);
            OutfiterOutfit outfit = new OutfiterOutfit();

            outfit.FromString(code);
            playerImageBox.Image = outfit.GetImage();
        }
コード例 #4
0
ファイル: PortraitTab.cs プロジェクト: umdez/Tibialyzer
        private void refreshCenterImage()
        {
            string centerLocation = SettingsManager.getSettingString("PortraitCenterImage");

            if (centerLocation == null)
            {
                return;
            }
            centerImageBox.Image = LoadImageFromPath(centerLocation);
            if (centerImageBox.Image == null)
            {
                OutfiterOutfit outfit = new OutfiterOutfit();
                outfit.FromString(centerLocation);
                centerImageBox.Image = outfit.GetImage();
                outfiterCode.Text    = centerLocation;
            }
        }
コード例 #5
0
        public HealthList()
        {
            InitializeComponent();

            this.BackColor       = StyleManager.BlendTransparencyKey;
            this.TransparencyKey = StyleManager.BlendTransparencyKey;

            displayNames    = SettingsManager.getSettingBool(GetHUD() + "DisplayNames");
            displayIcons    = SettingsManager.getSettingBool(GetHUD() + "DisplayIcons");
            displayText     = SettingsManager.getSettingBool(GetHUD() + "DisplayText");
            healthBarHeight = SettingsManager.getSettingInt(GetHUD() + "Height");
            playerBarHeight = displayNames ? healthBarHeight * 5 / 3 : healthBarHeight;

            List <string> names = SettingsManager.getSetting(GetHUD() + "PlayerNames");
            int           index = 0;

            foreach (string name in names)
            {
                if (name.Trim() == "")
                {
                    continue;
                }
                string imagePath = SettingsManager.getSettingString(GetHUD() + "Image" + index.ToString());
                Image  image     = null;
                if (imagePath != null)
                {
                    try {
                        image = Image.FromFile(imagePath);
                    } catch {
                        OutfiterOutfit outfit = new OutfiterOutfit();
                        outfit.FromString(imagePath);
                        image = outfit.GetImage();
                    }
                }
                this.players.Add(new PlayerEntry {
                    name = name, playerImage = image
                });
                index++;
            }

            double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity");

            opacity      = Math.Min(1, Math.Max(0, opacity));
            this.Opacity = opacity;
        }
コード例 #6
0
        private void nameListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (MainForm.prevent_settings_update)
            {
                return;
            }

            string imagePath = SettingsManager.getSettingString("HealthListImage" + nameListBox.SelectedIndex);

            playerImageBox.Image = null;
            if (imagePath != null)
            {
                try {
                    playerImageBox.Image = Image.FromFile(imagePath);
                } catch {
                    OutfiterOutfit outfit = new OutfiterOutfit();
                    outfit.FromString(imagePath);
                    playerImageBox.Image = outfit.GetImage();
                    outfiterCode.Text    = imagePath;
                }
            }
        }
コード例 #7
0
        public override void LoadHUD()
        {
            pictureBox           = new PictureBox();
            pictureBox.Location  = new Point(0, 0);
            pictureBox.Size      = new Size(this.Width, this.Height);
            pictureBox.BackColor = StyleManager.TransparencyKey;
            this.Controls.Add(pictureBox);

            string centerLocation = SettingsManager.getSettingString("PortraitCenterImage");

            if (centerLocation != null)
            {
                try {
                    centerImage = Image.FromFile(centerLocation);
                } catch {
                    OutfiterOutfit outfit = new OutfiterOutfit();
                    outfit.FromString(centerLocation);
                    using (Image image = outfit.GetImage()) {
                        using (Bitmap bitmap = new Bitmap(image)) {
                            centerImage = bitmap.Clamp();
                        }
                    }
                }
            }
            else
            {
                centerImage = null;
            }


            backgroundOffset = new Point(SettingsManager.getSettingInt("PortraitBackgroundXOffset"), SettingsManager.getSettingInt("PortraitBackgroundYOffset"));
            centerOffset     = new Point(SettingsManager.getSettingInt("PortraitCenterXOffset"), SettingsManager.getSettingInt("PortraitCenterYOffset"));

            backgroundScale = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitBackgroundScale")));
            centerScale     = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitCenterScale")));

            RefreshHUD();
        }
コード例 #8
0
ファイル: HealthList.cs プロジェクト: Mytherin/Tibialyzer
        public HealthList()
        {
            InitializeComponent();

            this.BackColor = StyleManager.BlendTransparencyKey;
            this.TransparencyKey = StyleManager.BlendTransparencyKey;

            displayNames = SettingsManager.getSettingBool(GetHUD() + "DisplayNames");
            displayIcons = SettingsManager.getSettingBool(GetHUD() + "DisplayIcons");
            displayText = SettingsManager.getSettingBool(GetHUD() + "DisplayText");
            healthBarHeight = SettingsManager.getSettingInt(GetHUD() + "Height");
            playerBarHeight = displayNames ? healthBarHeight * 5 / 3 : healthBarHeight;

            List<string> names = SettingsManager.getSetting(GetHUD() + "PlayerNames");
            int index = 0;
            foreach(string name in names) {
                if (name.Trim() == "") continue;
                string imagePath = SettingsManager.getSettingString(GetHUD() + "Image" + index.ToString());
                Image image = null;
                if (imagePath != null) {
                    try {
                        image = Image.FromFile(imagePath);
                    } catch {
                        OutfiterOutfit outfit = new OutfiterOutfit();
                        outfit.FromString(imagePath);
                        image = outfit.GetImage();
                    }
                }
                this.players.Add(new PlayerEntry { name = name, playerImage = image });
                index++;
            }

            double opacity = SettingsManager.getSettingDouble(GetHUD() + "Opacity");
            opacity = Math.Min(1, Math.Max(0, opacity));
            this.Opacity = opacity;
        }
コード例 #9
0
ファイル: HealthListTab.cs プロジェクト: Mytherin/Tibialyzer
        private void nameListBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (MainForm.prevent_settings_update) return;

            string imagePath = SettingsManager.getSettingString("HealthListImage" + nameListBox.SelectedIndex);

            playerImageBox.Image = null;
            if (imagePath != null) {
                try {
                    playerImageBox.Image = Image.FromFile(imagePath);
                } catch {
                    OutfiterOutfit outfit = new OutfiterOutfit();
                    outfit.FromString(imagePath);
                    playerImageBox.Image = outfit.GetImage();
                    outfiterCode.Text = imagePath;
                }
            }
        }
コード例 #10
0
ファイル: HealthListTab.cs プロジェクト: Mytherin/Tibialyzer
 private void outfiterButton_Click(object sender, EventArgs e)
 {
     int index = nameListBox.SelectedIndex;
     string code = outfiterCode.Text;
     SettingsManager.setSetting("HealthListImage" + index.ToString(), code);
     OutfiterOutfit outfit = new OutfiterOutfit();
     outfit.FromString(code);
     playerImageBox.Image = outfit.GetImage();
 }
コード例 #11
0
ファイル: PortraitTab.cs プロジェクト: Mytherin/Tibialyzer
 private void refreshCenterImage()
 {
     string centerLocation = SettingsManager.getSettingString("PortraitCenterImage");
     if (centerLocation == null) return;
     centerImageBox.Image = LoadImageFromPath(centerLocation);
     if (centerImageBox.Image == null) {
         OutfiterOutfit outfit = new OutfiterOutfit();
         outfit.FromString(centerLocation);
         centerImageBox.Image = outfit.GetImage();
         outfiterCode.Text = centerLocation;
     }
 }
コード例 #12
0
ファイル: Portrait.cs プロジェクト: Mytherin/Tibialyzer
        public override void LoadHUD()
        {
            pictureBox = new PictureBox();
            pictureBox.Location = new Point(0, 0);
            pictureBox.Size = new Size(this.Width, this.Height);
            pictureBox.BackColor = StyleManager.TransparencyKey;
            this.Controls.Add(pictureBox);

            string centerLocation = SettingsManager.getSettingString("PortraitCenterImage");
            if (centerLocation != null) {
                try {
                    centerImage = Image.FromFile(centerLocation);
                } catch {
                    OutfiterOutfit outfit = new OutfiterOutfit();
                    outfit.FromString(centerLocation);
                    using(Image image = outfit.GetImage()) {
                        using(Bitmap bitmap = new Bitmap(image)) {
                            centerImage = bitmap.Clamp();
                        }
                    }
                }
            } else {
                centerImage = null;
            }

            backgroundOffset = new Point(SettingsManager.getSettingInt("PortraitBackgroundXOffset"), SettingsManager.getSettingInt("PortraitBackgroundYOffset"));
            centerOffset = new Point(SettingsManager.getSettingInt("PortraitCenterXOffset"), SettingsManager.getSettingInt("PortraitCenterYOffset"));

            backgroundScale = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitBackgroundScale")));
            centerScale = Math.Min(100, Math.Max(0, SettingsManager.getSettingInt("PortraitCenterScale")));

            RefreshHUD();
        }