当前位置: 首页>>代码示例>>C#>>正文


C# Snapshot.ShowDialog方法代码示例

本文整理汇总了C#中Snapshot.ShowDialog方法的典型用法代码示例。如果您正苦于以下问题:C# Snapshot.ShowDialog方法的具体用法?C# Snapshot.ShowDialog怎么用?C# Snapshot.ShowDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Snapshot的用法示例。


在下文中一共展示了Snapshot.ShowDialog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CutBox_MouseDoubleClick

        void CutBox_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Panel panel = sender as Panel;

            Bitmap source = (Bitmap)panel.Parent.BackgroundImage;
            Utils.BitmapOperate bo = new Utils.BitmapOperate();
            Bitmap bmp = null;
            if (panel.Parent.Name == "ChampionPanel")
            {
                bmp = bo.GetPartOfImageRec(source,
                (Int32)Math.Round(panel.Width / 0.543),
                (Int32)Math.Round(panel.Height / 0.543),
                (Int32)Math.Round(panel.Left / 0.543),
                (Int32)Math.Round(panel.Top / 0.543));
            }
            else if (panel.Parent.Name == "ShotPanel")
            {
                bmp = bo.GetPartOfImageRec(source,
                (Int32)Math.Round(Convert.ToDouble(panel.Width / (Convert.ToDouble(panel.Parent.Width) / Convert.ToDouble(1215)))),
                (Int32)Math.Round(Convert.ToDouble(panel.Height / (Convert.ToDouble(panel.Parent.Height) / Convert.ToDouble(717)))),
                (Int32)Math.Round(Convert.ToDouble(panel.Left / (Convert.ToDouble(panel.Parent.Width) / Convert.ToDouble(1215)))),
                (Int32)Math.Round(Convert.ToDouble(panel.Top / (Convert.ToDouble(panel.Parent.Height) / Convert.ToDouble(717)))));
            }

            Datas.ChampionList ClistObj = new Datas.ChampionList();
            //Datas.LoginSeverList LlistObj = new Datas.LoginSeverList();
            Models.Champion champion = ClistObj.GetChampionById(panel.Parent.Tag.ToString());
            Utils.FileOperate fo = new Utils.FileOperate();

            Snapshot ss = new Snapshot();
            ss.ShotPanel.Width = panel.Width;
            ss.ShotPanel.Height = panel.Height;
            Point point = panel.PointToScreen(new Point(0,0));
            ss.StartPosition = FormStartPosition.Manual;
            ss.Location = new Point(point.X-15, point.Y-15);
            ss.ShotPanel.BackgroundImage = bmp;
            ss.ShotPanel.BackgroundImageLayout = ImageLayout.Stretch;
            ss.ChampionName.Tag = champion.EnName;

            if (champion.Spells != null && champion.Spells.Count > 0)
            {
                foreach (Models.Spell spell in champion.Spells)
                {
                    if (champion.EnName != "DrMundo")
                    {
                        Panel spellpanel = ss.ShotPanel.Controls.Find(spell.shortKey, true)[0] as Panel;
                        Bitmap spellbmp = bo.GetPartOfImageRec((fo.GetSpellPath() + spell.pathName + ".png"), spellpanel.Width - 3, spellpanel.Height - 3, spellpanel.Width, spellpanel.Height, -2, -2);
                        spellpanel.BackgroundImage = spellbmp;
                    }
                    else
                    {
                        if (spell.shortKey == "w")
                        {
                            Panel spellpanel = ss.ShotPanel.Controls.Find("w", true)[0] as Panel;
                            Bitmap spellbmp = bo.GetPartOfImageRec((global::SignatureBuilder.Properties.Resources.DrMundo_KissOfDeath), spellpanel.Width - 3, spellpanel.Height - 3, spellpanel.Width, spellpanel.Height, -2, -2);
                            spellpanel.BackgroundImage = spellbmp;
                        }
                        else if (spell.shortKey == "e")
                        {
                            Panel spellpanel = ss.ShotPanel.Controls.Find("e", true)[0] as Panel;
                            Bitmap spellbmp = bo.GetPartOfImageRec((global::SignatureBuilder.Properties.Resources.DrMundo_Masochism), spellpanel.Width - 3, spellpanel.Height - 3, spellpanel.Width, spellpanel.Height, -2, -2);
                            spellpanel.BackgroundImage = spellbmp;
                        }
                        else
                        {
                            Panel spellpanel = ss.ShotPanel.Controls.Find(spell.shortKey, true)[0] as Panel;
                            Bitmap spellbmp = bo.GetPartOfImageRec((fo.GetSpellPath() + spell.pathName + ".png"), spellpanel.Width - 3, spellpanel.Height - 3, spellpanel.Width, spellpanel.Height, -2, -2);
                            spellpanel.BackgroundImage = spellbmp;
                        }
                    }
                }
            }

            ss.ShowDialog(this);
        }
开发者ID:susnow,项目名称:LoLSignatureBuilder,代码行数:75,代码来源:CutBox.cs


注:本文中的Snapshot.ShowDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。