Example #1
0
        void Panel_Item_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (!ChampionPanel.Visible)
            {
                Panel panel = sender as Panel;
                Panel parent = panel.Parent as Panel;
                Label label = parent.GetChildAtPoint(new Point(0, 70)) as Label;
                Models.Champion champion = CListObj.GetChampionByKid(label.Text);
                Utils.FileOperate fo = new Utils.FileOperate();
                Utils.BitmapOperate bo = new Utils.BitmapOperate();
                ChampionName.Tag = champion.EnName;
                ChampionName.Text = champion.DefaultName + " - " + champion.CnName;
                ChampionSkinName.Text = "经典";

                string portraitPath = fo.GetAirChampionPortrait(champion);
                ChampionPortrait.BackgroundImage = Image.FromFile(portraitPath);

                string backgroundPath = fo.GetAirChampionSkinPath(0,champion);
                ChampionPanel.BackgroundImage = Image.FromFile(backgroundPath);
                ChampionPanel.Tag = ChampionName.Tag;

                for (int i = 0; i < previewList.Count; i++)
                {
                    previewList[i].BackgroundImage = null;
                    previewList[i].BorderStyle = BorderStyle.None;
                    previewList[i].Visible = false;
                }
                for (int i = 0; i < champion.Skins.Count; i++)
                {
                    string prePath = fo.GetAirChampionSkinPreviewPath(i, champion);
                    Bitmap bmp = bo.GetPartOfImageRec(prePath, 162, 43, 162, 295, 0, -50);

                    previewList[i].BackgroundImage = bmp;
                    previewList[i].BorderStyle = BorderStyle.FixedSingle;
                    previewList[i].Visible = true;
                }
                this.SkinPreviewPanel.BringToFront();
                this.SkinPreviewPanel.Visible = true;

                this.ActiveControl = this.SkinPreviewsPanel;
                this.ChampionPanel.BringToFront();
                this.ChampionPanel.Visible = true;

            }
        }
Example #2
0
 void SaveButton_Click(object sender, EventArgs e)
 {
     this.Focus();
     this.BringToFront();
     Utils.BitmapOperate bo = new Utils.BitmapOperate();
     Point point = PointToScreen(ShotPanel.Location);
     this.Sig.Show();
     this.FileLink.Show();
     this.SaveOK.Show();
     string path = bo.SaveBitMap(point.X, point.Y, this.ShotPanel.Width, this.ShotPanel.Height, this.ChampionName.Tag.ToString());
     this.FileLink.Text = System.IO.Path.GetFileNameWithoutExtension(path);
     this.FileLink.Tag = path;
 }