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


C# Size.ScaleSize方法代码示例

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


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

示例1: Drawing_OnEndScene

        private void Drawing_OnEndScene(EventArgs args)
        {
            if (!IsActive() || !_drawActive)
                return;
            try
            {
                float percentScale =
                    (float) Menu.UimTracker.GetMenuItem("SAwarenessUIMTrackerScale").GetValue<Slider>().Value/100;

                if (_s.IsDisposed)
                {
                    return;
                }
                _s.Begin();
                foreach (var enemy in _enemies)
                {
                    if (enemy.Key.IsVisible)
                        continue;
                    Vector2 serverPos = Drawing.WorldToMinimap(enemy.Key.ServerPosition);
                    var mPos = new Size((int) (serverPos[0] - 32*0.3f), (int) (serverPos[1] - 32*0.3f));
                    DirectXDrawer.DrawSprite(_s, enemy.Value,
                        mPos.ScaleSize(percentScale, new Vector2(mPos.Width, mPos.Height)),
                        new[] {0.7f*percentScale, 0.7f*percentScale});
                }
                _s.End();
                foreach (var enemy in _enemies)
                {
                    if (Menu.RecallDetector.GetActive())
                    {
                        RecallDetector.RecallInfo info = GetRecall(enemy.Key.NetworkId);
                        if (info != null && info.StartTime != 0)
                        {
                            float time = Game.Time + info.Recall.Duration/1000 - info.StartTime;
                            Vector2 vec = Drawing.WorldToMinimap(enemy.Key.ServerPosition);
                            var pos = new Size((int) vec.X, (int) vec.Y);
                            if (time > 0.0f &&
                                (info.Recall.Status == Packet.S2C.Recall.RecallStatus.TeleportStart ||
                                 info.Recall.Status == Packet.S2C.Recall.RecallStatus.RecallStarted))
                            {
                                DirectXDrawer.DrawText(_recF, enemy.Key.ChampionName, pos, SharpDX.Color.Chartreuse);
                            }
                        }
                    }
                }
                if (Menu.UimTracker.GetMenuItem("SAwarenessUIMTrackerShowSS").GetValue<bool>())
                {
                    foreach (var enemy in SsCaller.Enemies)
                    {
                        if (Menu.SsCaller.GetActive())
                        {
                            if (!enemy.Key.IsVisible && enemy.Value.InvisibleTime > 0)
                            {
                                Vector2 vec = Drawing.WorldToMinimap(enemy.Key.ServerPosition);
                                var pos = new Size((int)vec.X, (int)vec.Y);
                                DirectXDrawer.DrawText(_recF, enemy.Value.InvisibleTime.ToString(), pos, SharpDX.Color.Chartreuse);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                if (ex.GetType() == typeof (SharpDXException))
                {
                    Menu.UimTracker.SetActive(false);
                    Game.PrintChat("UIM: An error occured. Please activate UI Minimap in your menu again.");
                }
            }
        }
开发者ID:zjian1013,项目名称:SAwareness,代码行数:70,代码来源:Trackers.cs

示例2: Drawing_OnEndScene

        void Drawing_OnEndScene(EventArgs args)
        {
            if (!IsActive() || !drawActive)
                return;
            try
            {
                float percentScale = (float)Menu.UimTracker.GetMenuItem("SAwarenessUIMTrackerScale").GetValue<Slider>().Value / 100;

                if (S.IsDisposed)
                {
                    return;
                }
                S.Begin();
                foreach (var enemy in Enemies)
                {
                    if(enemy.Key.IsVisible)
                        continue;
                    Vector2 serverPos = Drawing.WorldToMinimap(enemy.Key.ServerPosition);
                    Size mPos = new Size((int) (serverPos[0] - 32 * 0.3f), (int) (serverPos[1] - 32 * 0.3f));
                    DirectXDrawer.DrawSprite(S, enemy.Value,
                        mPos.ScaleSize(percentScale, new Vector2(mPos.Width, mPos.Height)),
                        new[] {0.3f*percentScale, 0.3f*percentScale});
                }
                S.End();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
                if (ex.GetType() == typeof(SharpDXException))
                {
                    Menu.UimTracker.SetActive(false);
                    Game.PrintChat("UIM: An error occured. Please activate UI Minimap in your menu again.");
                }
            }
        }
开发者ID:hhhmmm2,项目名称:SAwareness,代码行数:35,代码来源:Trackers.cs


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