當前位置: 首頁>>代碼示例>>C#>>正文


C# RenderTarget.DrawBitmap方法代碼示例

本文整理匯總了C#中SharpDX.Direct2D1.RenderTarget.DrawBitmap方法的典型用法代碼示例。如果您正苦於以下問題:C# RenderTarget.DrawBitmap方法的具體用法?C# RenderTarget.DrawBitmap怎麽用?C# RenderTarget.DrawBitmap使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SharpDX.Direct2D1.RenderTarget的用法示例。


在下文中一共展示了RenderTarget.DrawBitmap方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Render

 public override void Render(RenderTarget pRender, float pPercent)
 {
     pRender.Transform = Matrix3x2.Identity;
     pRender.DrawText("dx:" + dx + "  dy:" + dy + "  da:" + da, Constants.SmallFont, new RectangleF(0, 0, 200, 50), new SolidColorBrush(pRender, Color4.Black));
     pRender.Transform = Matrix3x2.Rotation(MathUtil.DegreesToRadians(-a + 180)) * Matrix3x2.Translation(x, y);
     pRender.DrawBitmap(ShipBitmap, new RectangleF(-17, -17, 34, 34), 1.0f, BitmapInterpolationMode.Linear);
 }
開發者ID:jonathandlo,項目名稱:deep-space-dive,代碼行數:7,代碼來源:Ship.cs

示例2: Render

        internal void Render(RenderTarget d2dRenderTarget)
        {
            InitializeResources(d2dRenderTarget);

            d2dRenderTarget.Transform = Matrix.Translation(Position);
            d2dRenderTarget.DrawBitmap(texture,1, BitmapInterpolationMode.Linear);
            //d2dRenderTarget.FillRectangle(new RectangleF(-20, -20, 20, 20), Fill);

            //d2dRenderTarget.DrawRectangle(new RectangleF(-20, -20, 20, 20), Stroke);
        }
開發者ID:aL3891,項目名稱:KinectLight,代碼行數:10,代碼來源:ThingBase.cs

示例3: OnRender

        public void OnRender(RenderTarget target)
        {
            target.FillRectangle(new RectangleF(0, 0, mSize.X, mSize.Y), Brushes.Solid[0xFF333333]);
            if (mLoadingImage == null || mLoadingImage.IsLoaded == false)
                return;

            target.DrawBitmap(mLoadingImage, mTargetRectangle, 1.0f, BitmapInterpolationMode.Linear);

            if (mLoadingBarBackground == null || !mLoadingBarBackground.IsLoaded) return;

            var startPosY = mTargetRectangle.Y + mTargetRectangle.Height * 0.8f + 13;
            var startPosX = mTargetRectangle.X + (mTargetRectangle.Width - mLoadingBarBackground.Width * 1.2f + 80) / 2.0f;
            target.DrawBitmap(mLoadingBarFill,
                new RectangleF(startPosX, startPosY, (mLoadingBarBackground.Width * 1.2f - 80.0f) * mProgress, 40),
                1.0f, BitmapInterpolationMode.Linear);

            startPosY = mTargetRectangle.Y + mTargetRectangle.Height * 0.8f;
            startPosX = mTargetRectangle.X + (mTargetRectangle.Width  - mLoadingBarBackground.Width * 1.2f) / 2.0f;
            target.DrawBitmap(mLoadingBarBackground,
                new RectangleF(startPosX, startPosY, mLoadingBarBackground.Width * 1.2f, mLoadingBarBackground.Height),
                1.0f, BitmapInterpolationMode.Linear);
        }
開發者ID:Linrasis,項目名稱:WoWEditor,代碼行數:22,代碼來源:LoadingScreenView.cs

示例4: OnRender

        public void OnRender(RenderTarget target)
        {
            if (gBorder == null)
                InitBrushes();

            if(mIsHovered || mIsClicked)
            {
                if (mIsClicked)
                    target.FillRectangle(mTargetRect, gClick);
                else if (mIsHovered)
                    target.FillRectangle(mTargetRect, gHover);

                target.DrawRectangle(mTargetRect, gBorder);
            }

            target.DrawBitmap(mImage.GetBitmap(), mImageRect, 1.0f, BitmapInterpolationMode.Linear);
        }
開發者ID:Linrasis,項目名稱:WoWEditor,代碼行數:17,代碼來源:ImageButton.cs

示例5: DrawTexture

 public virtual void DrawTexture(RenderTarget g, RectangleF position)
 {
     g.DrawBitmap(Texture, position, 1, BitmapInterpolationMode.NearestNeighbor);
 }
開發者ID:Harrum,項目名稱:TestGamePlsIgnore,代碼行數:4,代碼來源:BaseTexture.cs

示例6: OnRender

        public void OnRender(RenderTarget target)
        {
            if (mImage == null)
                return;

            target.DrawBitmap(mImage, mTargetRectangle, 1.0f, BitmapInterpolationMode.Linear, mSourceRectangle);
            if (mIndexLocation == 0)
            {
                target.FillRoundedRectangle(new RoundedRectangle
                {
                    RadiusX = 5,
                    RadiusY = 5,
                    Rect = new RectangleF(Position.X + 5, Position.Y + 2, mIndexDraw.GetLayout().Metrics.Width + 10, mIndexDraw.GetLayout().Metrics.Height + 4)
                }, Brushes.Solid[0xDD555555]);
            }
            else
            {
                target.FillRoundedRectangle(new RoundedRectangle
                {
                    RadiusX = 5,
                    RadiusY = 5,
                    Rect = new RectangleF(Position.X + mTargetRectangle.Width - mIndexDraw.GetLayout().Metrics.Width - 15, Position.Y + 2, mIndexDraw.GetLayout().Metrics.Width + 10, mIndexDraw.GetLayout().Metrics.Height + 4)
                }, Brushes.Solid[0xDD555555]);
            }

            target.DrawTextLayout(new Vector2(mPosition.X + 10, mPosition.Y + 5), mIndexDraw, Brushes.White);
        }
開發者ID:Linrasis,項目名稱:WoWEditor,代碼行數:27,代碼來源:WdlControl.cs


注:本文中的SharpDX.Direct2D1.RenderTarget.DrawBitmap方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。