本文整理汇总了C#中SharpDX.Direct2D1.RenderTarget.PopAxisAlignedClip方法的典型用法代码示例。如果您正苦于以下问题:C# RenderTarget.PopAxisAlignedClip方法的具体用法?C# RenderTarget.PopAxisAlignedClip怎么用?C# RenderTarget.PopAxisAlignedClip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SharpDX.Direct2D1.RenderTarget
的用法示例。
在下文中一共展示了RenderTarget.PopAxisAlignedClip方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRender
public void OnRender(RenderTarget target)
{
target.PushAxisAlignedClip(new RectangleF(Position.X, Position.Y, Size.X, Size.Y), AntialiasMode.Aliased);
target.DrawTextLayout(Position, mTextDraw, Color, mMultiline ? DrawTextOptions.None : DrawTextOptions.Clip);
target.PopAxisAlignedClip();
}
示例2: OnRender
public void OnRender(RenderTarget target)
{
target.FillRectangle(new RectangleF(0, 0, mSize.X, mSize.Y), Brushes.Solid[0xFF333333]);
target.PushAxisAlignedClip(new RectangleF(0, 100, mSize.X, mSize.Y - 100), AntialiasMode.Aliased);
foreach (var label in mMapLabels)
label.OnRender(target);
target.PopAxisAlignedClip();
target.DrawLine(new Vector2(0, 100.0f), new Vector2(mSize.X, 100.0f), Brushes.White);
mTitleLabel.OnRender(target);
mLabelScroll.OnRender(target);
}
示例3: OnRender
public void OnRender(RenderTarget target)
{
var offset = mIsClicked ? new Vector2(1, 1) : new Vector2(0, 0);
target.FillRectangle(
!mIsClicked
? mRectangle
: new RectangleF(Position.X + offset.X, Position.Y + offset.Y, mSize.X - 2 * offset.X, mSize.Y - 2 * offset.Y),
mIsHovered ? mColorHover : mColor);
target.PushAxisAlignedClip(new RectangleF(Position.X + 2, Position.Y + 2, mSize.X - 4, mSize.Y - 4),
AntialiasMode.Aliased);
target.DrawTextLayout(new Vector2(Position.X + 2 + offset.X, Position.Y + 2 + offset.Y), mTextDraw, mIsHovered ? Brushes.Black : Brushes.White);
target.PopAxisAlignedClip();
}
示例4: OnRender
public void OnRender(RenderTarget target)
{
UpdateCaret();
var transform = target.Transform;
target.Transform *= Matrix3x2.Translation(Position);
target.AntialiasMode = AntialiasMode.Aliased;
target.FillRectangle(new RectangleF(0, 0, mSize.X, mSize.Y), Brushes.Solid[0xCC111111]);
target.DrawRectangle(new RectangleF(0, 0, mSize.X, mSize.Y), Brushes.Solid[System.Drawing.Color.White]);
target.PushAxisAlignedClip(new RectangleF(4, 0, mSize.X - 8, mSize.Y), AntialiasMode.Aliased);
target.DrawTextLayout(new Vector2(mStartPosition, 0), mTextDraw, Brushes.Solid[0xFFFFFFFF]);
target.PopAxisAlignedClip();
if (mCaretVisible && mIsFocused)
{
target.DrawLine(new Vector2(mCaretOffset, 4), new Vector2(mCaretOffset, 23),
Brushes.Solid[0xFFFFFFFF], 2.0f);
}
target.Transform = transform;
}
示例5: OnRender
public void OnRender(RenderTarget target)
{
target.AntialiasMode = AntialiasMode.Aliased;
target.FillRectangle(mClientRectangle, gBackground);
target.DrawRectangle(mClientRectangle, gBorder);
if (HasCaption)
{
target.FillRectangle(mCaptionRect, gBorder);
target.DrawTextLayout(new Vector2(Position.X + 5, Position.Y - 18.0f), mCaptionText, gCaptionText);
}
var oldTransform = target.Transform;
target.Transform *= mTransform;
target.PushAxisAlignedClip(mClipRect, AntialiasMode.Aliased);
lock(Children)
foreach (var child in Children) child.OnRender(target);
target.PopAxisAlignedClip();
target.Transform = oldTransform;
}
示例6: DrawFpsSamples
private void DrawFpsSamples(RenderTarget target)
{
var maxValue = mFpsSamples.Max();
var minValue = mFpsSamples.Min();
if (MathUtil.WithinEpsilon(minValue, maxValue, 0.5f)) maxValue = minValue + 10;
var baseOffset = 0.0f;
var step = mSize.X / 19.0f;
var diff = (DateTime.Now - mLastFpsSample);
if (mFpsSamples.Count == 20)
baseOffset = (float)diff.TotalSeconds * step;
var curPos = mFpsRectangle.Left - baseOffset;
var endY = mFpsRectangle.Bottom - 5;
var height = mFpsRectangle.Height - 20;
target.PushAxisAlignedClip(mFpsRectangle, AntialiasMode.Aliased);
for (var i = 1; i < mFpsSamples.Count; ++i)
{
var sat = (mFpsSamples[i] - minValue) / (maxValue - minValue);
var satPrev = (mFpsSamples[i - 1] - minValue) / (maxValue - minValue);
target.DrawLine(new Vector2(curPos, endY - satPrev * height), new Vector2(curPos + step, endY - sat * height), Brushes.White);
curPos += step;
}
var satLast = (mFpsSamples.Last() - minValue) / (maxValue - minValue);
target.DrawLine(new Vector2(curPos, endY - satLast * height),
new Vector2(curPos + (float)diff.TotalSeconds * step, endY - satLast * height), Brushes.White);
target.PopAxisAlignedClip();
mFpsMin.Text = minValue.ToString("F2");
mFpsMax.Text = maxValue.ToString("F2");
target.DrawTextLayout(new Vector2(Position.X + 3.0f, mFpsRectangle.Top - 20.0f), mFpsMax, Brushes.White);
target.DrawTextLayout(new Vector2(Position.X + 3.0f, mFpsRectangle.Bottom + 2.0f), mFpsMin, Brushes.White);
}
示例7: DrawMemorySamples
private void DrawMemorySamples(RenderTarget target)
{
var maxValue = mMemorySamples.Max();
var minValue = mMemorySamples.Min();
if (minValue == maxValue) maxValue = minValue + 50;
var baseOffset = 0.0f;
var step = mSize.X / 19.0f;
var diff = (DateTime.Now - mLastMemorySample);
if (mMemorySamples.Count == 20)
baseOffset = ((float)diff.TotalSeconds / 0.5f) * step;
var curPos = mMemoryRectangle.Left - baseOffset;
var endY = mMemoryRectangle.Bottom - 5;
var height = mMemoryRectangle.Height - 20;
target.PushAxisAlignedClip(mMemoryRectangle, AntialiasMode.Aliased);
for (var i = 1; i < mMemorySamples.Count; ++i)
{
var sat = (mMemorySamples[i] - (float)minValue) / (maxValue - minValue);
var satPrev = (mMemorySamples[i - 1] - (float)minValue) / (maxValue - minValue);
target.DrawLine(new Vector2(curPos, endY - satPrev * height), new Vector2(curPos + step, endY - sat * height), Brushes.White);
curPos += step;
}
var satLast = (mMemorySamples.Last() - (float) minValue) / (maxValue - minValue);
target.DrawLine(new Vector2(curPos, endY - satLast * height),
new Vector2(curPos + ((float)diff.TotalSeconds / 0.5f) * step, endY - satLast * height), Brushes.White);
target.PopAxisAlignedClip();
DrawMemoryStrings(target, maxValue, minValue);
}
示例8: Render
public override void Render(RenderTarget renderTarget)
{
if (!IsVisible) return;
CurrentBorderBrush.Resource.Opacity = this.Opacity;
CurrentBackgroundBrush.Resource.Opacity = this.Opacity;
renderTarget.Transform = this.Transform;
//TODO: Check if we need a second rect for this...
renderTarget.PushAxisAlignedClip(this.ClippingRectangle, AntialiasMode.Aliased);
try {
if (DrawBackground) {
renderTarget.FillGeometry(_backgroundGeometry, CurrentBackgroundBrush.Resource);
//if (CurrentBitmap != null)
// renderTarget.DrawBitmap(CurrentBitmap.Resource, Opacity, BitmapInterpolationMode.Linear);
}
if (DrawBorder)
renderTarget.DrawGeometry(_backgroundGeometry, CurrentBorderBrush.Resource);
if (DrawText && !String.IsNullOrEmpty(_text))
renderTarget.DrawTextLayout(new DrawingPointF(TextIndent, 0f), RenderedText, CurrentFontBrush.Resource);
base.Render(renderTarget);
} finally {
renderTarget.PopAxisAlignedClip();
}
}