• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Direct3D9.Sprite类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SharpDX.Direct3D9.Sprite的典型用法代码示例。如果您正苦于以下问题:C# Sprite类的具体用法?C# Sprite怎么用?C# Sprite使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Sprite类属于SharpDX.Direct3D9命名空间,在下文中一共展示了Sprite类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ConvertToBitmap

        public Bitmap ConvertToBitmap(string filePath)
        {
            using (var texture = Texture.FromFile(device, filePath)) {
            var surfaceDescription = texture.GetLevelDescription(0);
            var textureWidth = surfaceDescription.Width;
            var textureHeight = surfaceDescription.Height;

            using (var renderTarget = Surface.CreateRenderTarget(device, textureWidth, textureHeight, Format.X8R8G8B8, MultisampleType.None, 0, true)) {
               var oldBackBuffer = device.GetRenderTarget(0);

               device.SetRenderTarget(0, renderTarget);
               using (var sprite = new Sprite(device)) {
                  device.BeginScene();
                  sprite.Begin(SpriteFlags.AlphaBlend);
                  sprite.Draw(texture, new ColorBGRA(Vector4.One));
                  sprite.End();
                  device.EndScene();
               }
               device.SetRenderTarget(0, oldBackBuffer);

               var renderTargetData = renderTarget.LockRectangle(LockFlags.ReadOnly);
               var resultBitmap = new Bitmap(textureWidth, textureHeight);
               var resultData = resultBitmap.LockBits(new Rectangle(0, 0, textureWidth, textureHeight), ImageLockMode.WriteOnly, PixelFormat.Format32bppRgb);
               for (var y = 0; y < textureHeight; y++) {
                  Utilities.CopyMemory(resultData.Scan0 + y * resultData.Stride, renderTargetData.DataPointer + y * renderTargetData.Pitch, textureWidth * 4);
               }
               resultBitmap.UnlockBits(resultData);
               renderTarget.UnlockRectangle();
               return resultBitmap;
            }
             }
        }
开发者ID:ItzWarty,项目名称:the-dargon-project,代码行数:32,代码来源:TextureConverter.cs


示例2: Initialise

        public bool Initialise(Device device)
        {
            Debug.Assert(!_initialised);
            if (_initialising)
                return false;

            _initialising = true;

            try
            {

                _device = device;

                _sprite = ToDispose(new Sprite(_device));

                // Initialise any resources required for overlay elements
                IntialiseElementResources();

                _initialised = true;
                return true;
            }
            finally
            {
                _initialising = false;
            }
        }
开发者ID:Fujimuji,项目名称:Direct3DHook,代码行数:26,代码来源:DXOverlayEngine.cs


示例3: SkillBar

        public SkillBar(Menu config)
        {
            MenuSkillBar = config.AddSubMenu(new Menu("Cooldown Tracker", "SkillBar"));
            MenuSkillBar.AddItem(new MenuItem("OnAllies", "On Allies").SetValue(false));
            MenuSkillBar.AddItem(new MenuItem("OnEnemies", "On Enemies").SetValue(true));
            Sprite = new Sprite(Drawing.Direct3DDevice);
            HudTexture = Texture.FromMemory(
                Drawing.Direct3DDevice, (byte[]) new ImageConverter().ConvertTo(Resources.main, typeof(byte[])), 127, 41,
                0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0);
            FrameLevelTexture = Texture.FromMemory(
                Drawing.Direct3DDevice, (byte[]) new ImageConverter().ConvertTo(Resources.spell_level, typeof(byte[])),
                2, 3, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0);
            ButtonRedTexture = Texture.FromMemory(
                Drawing.Direct3DDevice, (byte[]) new ImageConverter().ConvertTo(Resources.disable, typeof(byte[])), 14,
                14, 0, Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0);
            SmallText = new Font(
                Drawing.Direct3DDevice,
                new FontDescription
                {
                    FaceName = "Calibri",
                    Height = 13,
                    OutputPrecision = FontPrecision.Default,
                    Quality = FontQuality.Default,
                });

            AppDomain.CurrentDomain.DomainUnload += DomainUnload;
            AppDomain.CurrentDomain.ProcessExit += DomainUnload;
            CustomEvents.Game.OnGameLoad += Game_OnGameLoad;
        }
开发者ID:AwkwardDev,项目名称:LeagueSharp2,代码行数:29,代码来源:SkillBar.cs


示例4: BlurComponent

        public BlurComponent(Device graphics, int size)
        {
            _graphics = graphics;

            Dims = size;
            Format = Format.A8R8G8B8;

            _sampleOffsetsHoriz = new Vector4D[SampleCount];
            _sampleOffsetsVert = new Vector4D[SampleCount];

            _sampleWeightsHoriz = new float[SampleCount];
            _sampleWeightsVert = new float[SampleCount];

            int width = Dims - 5;
            int height = Dims - 5;

            SetBlurEffectParameters(1.0f / width, 0, ref _sampleOffsetsHoriz, ref _sampleWeightsHoriz);
            SetBlurEffectParameters(0, 1.0f / height, ref _sampleOffsetsVert, ref _sampleWeightsVert);

            _effect = new GaussianBlurEffect(_graphics);

            OutputTexture = new Texture(_graphics, Dims, Dims, 1, Usage.RenderTarget, Format, Pool.Default);
            _intermediateTexture = new Texture(_graphics, Dims, Dims, 1, Usage.RenderTarget, Format, Pool.Default);

            _sprite = new Sprite(_graphics);
        }
开发者ID:tgjones,项目名称:meshellator,代码行数:26,代码来源:BlurComponent.cs


示例5: GetCenteredText

 /// <summary>
 ///     Calculates the center position for the given text on within a rectangle boundaries.
 /// </summary>
 /// <param name="rectangle">Rectangle boundaries</param>
 /// <param name="sprite">Sprite which is being drawn on</param>
 /// <param name="text">The Text</param>
 /// <param name="flags">Centered Flags</param>
 /// <returns>Returns the center position of the text on the rectangle.</returns>
 public static Vector2 GetCenteredText(
     this SharpDX.Rectangle rectangle,
     Sprite sprite,
     string text,
     CenteredFlags flags)
 {
     return rectangle.GetCenter(sprite, Constants.LeagueSharpFont.MeasureText(sprite, text, 0), flags);
 }
开发者ID:parkyoungsoo,项目名称:LeagueSharp.SDK,代码行数:16,代码来源:Geometry.cs


示例6: HpBarIndicator

        public HpBarIndicator()
        {
            dxLine = new Line(dxDevice) { Width = 9 };
            sprite = new Sprite(dxDevice);

            Drawing.OnPreReset += DrawingOnOnPreReset;
            Drawing.OnPostReset += DrawingOnOnPostReset;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload;
            AppDomain.CurrentDomain.ProcessExit += CurrentDomainOnDomainUnload;
        }
开发者ID:Merc491,项目名称:GoodGuyJodu,代码行数:10,代码来源:HpBarIndicator.cs


示例7: DeathDraw

        public DeathDraw()
        {
            dxLine = new Line(dxDevice) { Width = 9 };
            sprite = new Sprite(dxDevice);

            Drawing.OnPreReset += DrawingOnOnPreReset;
            Drawing.OnPostReset += DrawingOnOnPostReset;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload;
            AppDomain.CurrentDomain.ProcessExit += CurrentDomainOnDomainUnload;
            windowsH = dxDevice.Viewport.Height;
            windowsW = dxDevice.Viewport.Width;
            Console.WriteLine("Xtest: " + dxDevice.Viewport.Width + " : " + dxDevice.Viewport.Height);

        }
开发者ID:Sthephanfelix,项目名称:LeagueSharp-4,代码行数:14,代码来源:DeathDraw.cs


示例8: Game_OnGameLoad

 static void Game_OnGameLoad(EventArgs args)
 {
     Game.PrintChat("Unban.exe By DZ191 Loaded. Credits to DETUKS");
     sprite = new Sprite(dxDevice);
    taco = Texture.FromMemory(
             Drawing.Direct3DDevice,
             (byte[])new ImageConverter().ConvertTo(LoadPicture("http://puu.sh/cP1qD/d23cd24220.jpg"), typeof(byte[])), 513, 744, 0,
             Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0);
     Drawing.OnEndScene += Drawing_OnEndScene;
     Drawing.OnPreReset += DrawingOnOnPreReset;
     Drawing.OnPostReset += DrawingOnOnPostReset;
     AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload;
     AppDomain.CurrentDomain.ProcessExit += CurrentDomainOnDomainUnload;
 }
开发者ID:luizssn,项目名称:LeagueSharp,代码行数:14,代码来源:Program.cs


示例9: MeasureText

        public static Rectangle MeasureText(this Font font, Sprite sprite, string text)
        {
            Dictionary<string, Rectangle> rectangles;
            if (!Widths.TryGetValue(font, out rectangles))
            {
                rectangles = new Dictionary<string, Rectangle>();
                Widths[font] = rectangles;
            }

            Rectangle rectangle;
            if (rectangles.TryGetValue(text, out rectangle))
            {
                return rectangle;
            }
            rectangle = font.MeasureText(sprite, text, 0);
            rectangles[text] = rectangle;
            return rectangle;
        }
开发者ID:nguyenduykhai123,项目名称:L-Assemblies,代码行数:18,代码来源:Render.cs


示例10: InitTexture

    private void InitTexture(BluRayAPI.OSDTexture item)
    {
      if (item.Width == 0 || item.Height == 0 || item.Texture == IntPtr.Zero)
      {
        FreeResources();
        return;
      }

      if (_combinedOsdTexture == null || _combinedOsdTexture.IsDisposed)
      {
        _combinedOsdTexture = new Texture(_device, _fullOsdSize.Width, _fullOsdSize.Height, 1, Usage.RenderTarget, FORMAT, Pool.Default);
        _combinedOsdSurface = _combinedOsdTexture.GetSurfaceLevel(0);

        _sprite = new Sprite(_device);

        Rectangle dstRect = new Rectangle(0, 0, _fullOsdSize.Width, _fullOsdSize.Height);
        _device.ColorFill(_combinedOsdSurface, dstRect, _transparentColor);
      }
    }
开发者ID:davinx,项目名称:MediaPortal-2,代码行数:19,代码来源:BluRayOSDRenderer.cs


示例11: HbTracker

        static HbTracker()
        {
            if (!Game.Version.Contains("4.19"))
            {
                SummonerSpellSlots = new[] { SpellSlot.Q, SpellSlot.W };
            }

            try
            {
                foreach (var sName in SummonersNames)
                {
                    SummonerTextures.Add(sName, GetSummonerTexture(sName));
                }

                Sprite = new Sprite(Drawing.Direct3DDevice);
                CdFrameTexture = Texture.FromMemory(
                    Drawing.Direct3DDevice,
                    (byte[]) new ImageConverter().ConvertTo(Properties.Resources.hud, typeof(byte[])), 147, 27, 0,
                    Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0);

                ReadyLine = new Line(Drawing.Direct3DDevice) { Width = 2 };

                Text = new Font(
                    Drawing.Direct3DDevice,
                    new FontDescription
                    {
                        FaceName = "Calibri",
                        Height = 13,
                        OutputPrecision = FontPrecision.Default,
                        Quality = FontQuality.Default,
                    });
            }
            catch (Exception e)
            {
                Console.WriteLine(@"/ff can't load the textures: " + e);
            }

            Drawing.OnPreReset += DrawingOnOnPreReset;
            Drawing.OnPostReset += DrawingOnOnPostReset;
            Drawing.OnDraw += Drawing_OnEndScene;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload;
            AppDomain.CurrentDomain.ProcessExit += CurrentDomainOnDomainUnload;
        }
开发者ID:lanyi777,项目名称:CN,代码行数:43,代码来源:HbTracker.cs


示例12: Tracker

        static Tracker()
        {
            foreach (var sName in SummonersNames)
                SummonerTextures.Add(sName.ToLower(), GetSummonerTexture(sName.ToLower()));
            foreach (var slot in SpellSlots)
                SpellTextures.Add(slot.ToString(), GetSpellTexture(slot.ToString()));

            Sprite = new Sprite(Drawing.Direct3DDevice);
            TextureOther = Texture.FromMemory(
            Drawing.Direct3DDevice,
            (byte[])new ImageConverter().ConvertTo(Properties.Resources.Healthbar_Tracker_Others, typeof(byte[])), 131, 17, 0,
            Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0);
            TextureMe = Texture.FromMemory(
            Drawing.Direct3DDevice,
            (byte[])new ImageConverter().ConvertTo(Properties.Resources.Healthbar_Tracker2, typeof(byte[])), 131, 17, 0,
            Usage.None, Format.A1, Pool.Managed, Filter.Default, Filter.Default, 0);
            Drawing.OnPreReset += DrawingOnOnPreReset;
            Drawing.OnPostReset += DrawingOnOnPostReset;
            Drawing.OnDraw += Drawing_OnDraw;
            AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload;
            AppDomain.CurrentDomain.ProcessExit += CurrentDomainOnDomainUnload;
        }
开发者ID:lanyi777,项目名称:CN,代码行数:22,代码来源:Tracker.cs


示例13: GetCenter

        /// <summary>
        ///     Returns the center position of the rendering object on the rectangle.
        /// </summary>
        /// <param name="rectangle">Rectangle boundaries</param>
        /// <param name="sprite">Sprite which is being drawn on</param>
        /// <param name="dimensions">Object Dimensions</param>
        /// <param name="flags">Centered Flags</param>
        /// <returns>Vector2 center position of the rendering object on the rectangle.</returns>
        public static Vector2 GetCenter(
            this Rectangle rectangle, 
            Sprite sprite, 
            Rectangle dimensions, 
            CenteredFlags flags)
        {
            var x = 0;
            var y = 0;

            if (flags.HasFlag(CenteredFlags.HorizontalLeft))
            {
                x = rectangle.TopLeft.X;
            }
            else if (flags.HasFlag(CenteredFlags.HorizontalCenter))
            {
                x = rectangle.TopLeft.X + (rectangle.Width - dimensions.Width) / 2;
            }
            else if (flags.HasFlag(CenteredFlags.HorizontalRight))
            {
                x = rectangle.TopRight.X - dimensions.Width;
            }

            if (flags.HasFlag(CenteredFlags.VerticalUp))
            {
                y = rectangle.TopLeft.Y;
            }
            else if (flags.HasFlag(CenteredFlags.VerticalCenter))
            {
                y = rectangle.TopLeft.Y + (rectangle.Height - dimensions.Height) / 2;
            }
            else if (flags.HasFlag(CenteredFlags.VerticalDown))
            {
                y = rectangle.BottomLeft.Y - dimensions.Height;
            }

            return new Vector2(x, y);
        }
开发者ID:8569482,项目名称:LeagueSharp.SDK,代码行数:45,代码来源:Geometry.cs


示例14: GetSprite

 public static Sprite GetSprite()
 {
     try
     {
         _sprite = new Sprite(Drawing.Direct3DDevice);
     }
     catch (Exception e)
     {
         Console.WriteLine(@"An error occurred: '{0}'", e);
     }
     return _sprite;
 }
开发者ID:yashine59fr,项目名称:PortAIO-1,代码行数:12,代码来源:MDrawing.cs


示例15: GetCenteredText

 /// <summary>
 ///     Calculates the center position for the given text on within a rectangle boundaries.
 /// </summary>
 /// <param name="rectangle">Rectangle boundaries</param>
 /// <param name="sprite">Sprite which is being drawn on</param>
 /// <param name="font">Text Font</param>
 /// <param name="text">The Text</param>
 /// <param name="flags">Centered Flags</param>
 /// <returns>Returns the center position of the text on the rectangle.</returns>
 public static Vector2 GetCenteredText(
     this Rectangle rectangle, 
     Sprite sprite, 
     Font font, 
     string text, 
     CenteredFlags flags)
 {
     return font == null
                ? rectangle.GetCenteredText(sprite, text, flags)
                : rectangle.GetCenter(sprite, font.MeasureText(sprite, text, 0), flags);
 }
开发者ID:8569482,项目名称:LeagueSharp.SDK,代码行数:20,代码来源:Geometry.cs


示例16: MeasureText

 /// <summary>
 /// Measures the specified sprite.
 /// </summary>
 /// <param name="sprite">Pointer to an <see cref="SharpDX.Direct3D9.Sprite"/> object that contains the string. Can be <c>null</c>, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row.</param>
 /// <param name="text"><para>Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated.</para></param>	
 /// <param name="rect"><para>Pointer to a <see cref="SharpDX.Rectangle"/> structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top.</para></param>	
 /// <param name="drawFlags"><para> </para><para>Specifies the method of formatting the text. It can be any combination of the following values:</para>  ValueMeaning <list> <item><term>DT_BOTTOM</term> </list>  <para>Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE.</para>  <list> <item><term>DT_CALCRECT</term> </list>  <para>Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.</para>  <list> <item><term>DT_CENTER</term> </list>  <para>Centers text horizontally in the rectangle.</para>  <list> <item><term>DT_EXPANDTABS</term> </list>  <para>Expands tab characters. The default number of characters per tab is eight.</para>  <list> <item><term>DT_LEFT</term> </list>  <para>Aligns text to the left.</para>  <list> <item><term>DT_NOCLIP</term> </list>  <para>Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used.</para>  <list> <item><term>DT_RIGHT</term> </list>  <para>Aligns text to the right.</para>  <list> <item><term>DT_RTLREADING</term> </list>  <para>Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right.</para>  <list> <item><term>DT_SINGLELINE</term> </list>  <para>Displays text on a single line only. Carriage returns and line feeds do not break the line.</para>  <list> <item><term>DT_TOP</term> </list>  <para>Top-justifies text.</para>  <list> <item><term>DT_VCENTER</term> </list>  <para>Centers text vertically (single line only).</para>  <list> <item><term>DT_WORDBREAK</term> </list>  <para>Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line.</para>   <para>?</para></param>
 /// <param name="textHeight">The height of the formatted text but does not draw the text.</param>	
 /// <returns>Determines the width and height of the rectangle. If there are multiple lines of text, this function uses the width of the rectangle pointed to by the rect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, this method modifies the right side of the rectangle so that it bounds the last character in the line. </returns>
 public unsafe SharpDX.Rectangle MeasureText(Sprite sprite, string text, SharpDX.Rectangle rect, FontDrawFlags drawFlags, out int textHeight)
 {
     // DT_CALCRECT
     textHeight = DrawText(sprite, text, text.Length, new IntPtr(&rect), ((int)drawFlags) | 0x400, Color.White);
     return rect;
 }
开发者ID:Nezz,项目名称:SharpDX,代码行数:15,代码来源:Font.cs


示例17: DrawSprite

 public static void DrawSprite(Sprite sprite, Texture texture, Size size, Color color, Rectangle? spriteResize)
 {
     if (sprite != null && texture != null)
     {
         sprite.Draw(texture, color, spriteResize, new Vector3(size.Width, size.Height, 0));
     }
 }
开发者ID:AwkwardDev,项目名称:LeagueSharp2,代码行数:7,代码来源:Utils.cs


示例18: DrawTransformedSprite

 public static void DrawTransformedSprite(Sprite sprite, Texture texture, Rectangle spriteResize, Color color)
 {
     if (sprite != null && texture != null)
     {
         sprite.Draw(texture, color);
     }
 }
开发者ID:AwkwardDev,项目名称:LeagueSharp2,代码行数:7,代码来源:Utils.cs


示例19: DrawOverlay

    public void DrawOverlay(Texture targetTexture)
    {
      Subtitle currentSubtitle;
      lock (_syncObj)
      {
        currentSubtitle = _subtitles.ToList().FirstOrDefault(s => s.ShouldDraw);
        if (currentSubtitle == null)
          return;

        if (targetTexture == null || targetTexture.IsDisposed || currentSubtitle.SubTexture == null || currentSubtitle.SubTexture.IsDisposed)
        {
          if (_drawCount > 0)
            ServiceRegistration.Get<ILogger>().Debug("Draw count for last sub: {0}", _drawCount);
          _drawCount = 0;
          return;
        }
        _drawCount++;
      }

      try
      {
        // TemporaryRenderTarget changes RenderTarget to texture and restores settings when done (Dispose)
        using (new TemporaryRenderTarget(targetTexture))
        using (TemporaryRenderState temporaryRenderState = new TemporaryRenderState())
        using (Sprite sprite = new Sprite(_device))
        {
          sprite.Begin(SpriteFlags.AlphaBlend);
          // No alpha test here, allow all values
          temporaryRenderState.SetTemporaryRenderState(RenderState.AlphaTestEnable, 0);

          // Use the SourceAlpha channel and InverseSourceAlpha for destination
          temporaryRenderState.SetTemporaryRenderState(RenderState.BlendOperation, (int)BlendOperation.Add);
          temporaryRenderState.SetTemporaryRenderState(RenderState.SourceBlend, (int)Blend.SourceAlpha);
          temporaryRenderState.SetTemporaryRenderState(RenderState.DestinationBlend, (int)Blend.InverseSourceAlpha);

          // Check the target texture dimensions and adjust scaling and translation
          SurfaceDescription desc = targetTexture.GetLevelDescription(0);
          Matrix transform = Matrix.Identity;

          // Position subtitle and scale it to match video frame size, if required
          transform *= Matrix.Translation(currentSubtitle.HorizontalPosition, currentSubtitle.FirstScanLine, 0);

          if (currentSubtitle.ScreenWidth != desc.Width || currentSubtitle.ScreenHeight != desc.Height)
          {
            var factorW = (float)desc.Width / currentSubtitle.ScreenWidth;
            var factorH = (float)desc.Height / currentSubtitle.ScreenHeight;
            transform *= Matrix.Scaling(factorW, factorH, 1);
          }

          sprite.Transform = transform;
          sprite.Draw(currentSubtitle.SubTexture, SharpDX.Color.White);
          sprite.End();
        }

        if (_onTextureInvalidated != null)
          _onTextureInvalidated();
      }
      catch (Exception ex)
      {
        ServiceRegistration.Get<ILogger>().Debug("Error in DrawOverlay", ex);
      }
    }
开发者ID:aspik,项目名称:MediaPortal-2,代码行数:62,代码来源:SubtitleRenderer.cs


示例20: PrepareDrawing

        /// <summary>
        ///    Initialize the Drawing tools
        /// </summary>
        private static void PrepareDrawing()
        {
            int fontsize = (int)(ScaleValue(15, Direction.Y));

            Text = new Font(
                Drawing.Direct3DDevice,
                new FontDescription
                {
                    FaceName = "Tahoma",
                    Height = fontsize < 15 ? 15 : fontsize,
                    OutputPrecision = FontPrecision.Default,
                    Quality = FontQuality.Default
                });

            sprite = new Sprite(Drawing.Direct3DDevice);
            BoxLine = new Line(Drawing.Direct3DDevice) { Width = 1 };
        }
开发者ID:47110572,项目名称:CN,代码行数:20,代码来源:PermaShow.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Direct3D9.Texture类代码示例发布时间:2022-05-26
下一篇:
C# Direct3D9.PaletteEntry类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap