本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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);
}
示例5: DrawTexture
public virtual void DrawTexture(RenderTarget g, RectangleF position)
{
g.DrawBitmap(Texture, position, 1, BitmapInterpolationMode.NearestNeighbor);
}
示例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);
}