本文整理匯總了C#中SharpDX.Direct2D1.RenderTarget.FillRectangle方法的典型用法代碼示例。如果您正苦於以下問題:C# RenderTarget.FillRectangle方法的具體用法?C# RenderTarget.FillRectangle怎麽用?C# RenderTarget.FillRectangle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SharpDX.Direct2D1.RenderTarget
的用法示例。
在下文中一共展示了RenderTarget.FillRectangle方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnRender
public void OnRender(RenderTarget target)
{
var brush = gBackground;
if (mIsClicked)
brush = gBackgroundClick;
else if (mIsHovered)
brush = gBackgroundHover;
target.FillRectangle(mClientRectangle, gBorder);
target.FillRectangle(new RectangleF(Position.X + 1, Position.Y + 1, Size.X - 2, Size.Y - 2), brush);
target.DrawTextLayout(new Vector2(Position.X + 2, Position.Y + 2), mTextDraw, gCaptionColor, DrawTextOptions.Clip);
}
示例2: OnRender
public void OnRender(RenderTarget target)
{
if(gBorderBrush == null)
{
gBackgroundBrush = Brushes.Solid[0xCC555555];
gBackgroundHoverBrush = Brushes.Solid[0xCC888888];
gClickBrush = Brushes.Solid[0xFFFF7F00];
gBackgroundClickedBrush = Brushes.Solid[0xCCBBBBBB];
gBorderBrush = Brushes.White;
}
target.DrawTextLayout(new Vector2(Position.X + Size + 7, Position.Y - 2), mTextDraw, Brushes.White);
var brush = gBackgroundBrush;
if (mIsPressed)
brush = gBackgroundClickedBrush;
else if (mIsHovered)
brush = gBackgroundHoverBrush;
target.FillRectangle(mTargetRect, brush);
target.DrawRectangle(mTargetRect, gBorderBrush);
if (!Checked) return;
target.DrawLine(Position + new Vector2(3, 3), Position + new Vector2(mSize - 3, mSize - 3), gClickBrush,
mSize / 4.0f);
target.DrawLine(new Vector2(Position.X + 3, Position.Y + mSize - 3),
new Vector2(Position.X + mSize - 3, Position.Y + 3), gClickBrush, mSize / 4.0f);
}
示例3: 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);
}
示例4: Render
public override void Render(RenderTarget pRender, float pPercent)
{
pRender.Transform = Matrix3x2.Identity;
RectangleF rect = new RectangleF(x, y, width, height);
pRender.FillRectangle(rect, highlight ? highlightBrush : backBrush);
pRender.DrawRectangle(rect, borderBrush);
pRender.DrawTextLayout(new Vector2(x + dx * (pPercent - 1), y + dy * (pPercent - 1)), textLayout, textBrush);
}
示例5: OnRender
public void OnRender(RenderTarget target)
{
target.FillRectangle(new RectangleF(0, 0, mSize.X, mSize.Y), Brushes.Solid[0xFF333333]);
mAppTitle.OnRender(target);
mDescription.OnRender(target);
mInputPath.OnRender(target);
mBrowseButton.OnRender(target);
mRegistryButton.OnRender(target);
mConfirmButton.OnRender(target);
}
示例6: 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);
}
示例7: 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();
}
示例8: 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;
}
示例9: OnRender
public void OnRender(RenderTarget target)
{
var color = Brushes.Solid[0xFFAAAAAA];
if (mIsKnobDown)
color = Brushes.White;
else if (mIsKnobHovered)
color = Brushes.Solid[0xFFDDDDDD];
var fact = VisibleSize / TotalSize;
var scrollStart = (mScrollOffset / TotalSize) * Size;
target.FillRectangle(
new RectangleF(Position.X + (Vertical ? 0 : scrollStart), Position.Y + (Vertical ? scrollStart : 0), Vertical ? Thickness : (Size * fact),
Vertical ? (Size * fact) : Thickness), color);
}
示例10: OnRender
public void OnRender(RenderTarget target)
{
var borderStart = new Vector2(mPosition.X + BorderOffsets.X, mPosition.Y);
var borderEnd = new Vector2(mPosition.X + mSize.X - BorderOffsets.Y, mPosition.Y);
target.FillRectangle(mTargetRectangle, Brushes.Solid[0xCC333333]);
target.DrawLine(borderStart, borderEnd, Brushes.White);
var ot = target.Transform;
target.Transform *= Matrix3x2.Translation(Position.X, Position.Y);
foreach (var item in Items)
item.OnRender(target);
target.Transform = ot;
}
示例11: OnRender
public void OnRender(RenderTarget target)
{
var msDiff = (DateTime.Now - mAnimTime).Milliseconds;
var numDots = msDiff > 750 ? 3 : (msDiff > 500 ? 2 : (msDiff > 250 ? 1 : 0));
var text = "Loading files";
for (var i = 0; i < numDots; ++i)
{
text = '-' + text;
text += '-';
}
if (mLoadIndicator.Text.Equals(text) == false)
mLoadIndicator.Text = text;
target.FillRectangle(new RectangleF(0, 0, mSize.X, mSize.Y), Brushes.Solid[0xFF333333]);
mLoadIndicator.OnRender(target);
}
示例12: 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;
}
示例13: 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);
}
示例14: Draw
public void Draw(RenderTarget renderTarget)
{
renderTarget.FillRectangle(OutputRectangle, _backgroundColor.Resource);
var bufferedLine = _buffer.First;
// Move to current line
for (int i = 0; i < _currentLine; i++)
bufferedLine = bufferedLine.Next;
DrawingPointF origin = new DrawingPointF(0f, OutputRectangle.Bottom);
while (origin.Y > 0f && bufferedLine != null) {
origin.Y -= bufferedLine.Value.Text.Metrics.Height;
renderTarget.DrawTextLayout(origin, bufferedLine.Value.Text, bufferedLine.Value.TextColor);
bufferedLine = bufferedLine.Next;
}
}
示例15: OnEditViewportDrawPrimitives
private void OnEditViewportDrawPrimitives(Device device, RenderTarget target2D, Rectangle cliprectangle)
{
UiEncodingWindowSource source = _currentSource;
WflContent info = source?.Info;
if (info?.Header.TableType != WflHeader.LargeTable)
return;
int viewportX = _editViewport.X;
int viewportY = _editViewport.Y;
RectangleF rectangle = new RectangleF {Height = info.Header.LineHeight};
target2D.BeginDraw();
for (int i = 0; i < 256 * 2; i++)
{
if (i % 256 < 0x20)
continue;
int x, y;
info.GetOffsets(i, out x, out y);
x -= viewportX;
y -= viewportY;
byte before, width, after;
info.GetSizes(i, out before, out width, out after);
rectangle.X = x;
rectangle.Y = y;
rectangle.Width = width & 0x7F;
if (_charactersControl.CurrentMainIndices.Contains(i))
{
target2D.FillRectangle(rectangle, _selectedColorBrush);
if (before > 0x7F)
{
rectangle.Width = (0xFF - before) + 1;
rectangle.X = x;
}
else
{
rectangle.Width = before;
rectangle.X = x - before;
}
target2D.FillRectangle(rectangle, _spacingColorBrush);
if (after > 0x7F)
{
rectangle.Width = (0xFF - after) + 1;
rectangle.X = x + (width & 0x7F) - rectangle.Width;
}
else
{
rectangle.Width = after;
rectangle.X = x + width & 0x7F;
}
target2D.FillRectangle(rectangle, _spacingColorBrush);
}
else if (source.Chars[i % 256] == 0x00)
{
target2D.FillRectangle(rectangle, _notMappedColorBrush);
}
else
{
target2D.DrawRectangle(rectangle, _gridColorBrush, 1.0f);
}
}
int squareSize = info.Header.LineSpacing + info.Header.SquareDiff;
rectangle.Height = squareSize;
rectangle.Width = squareSize;
for (int i = 0; i < info.AdditionalTable.Length; i++)
{
int value = info.AdditionalTable[i];
if (value == 0)
continue;
rectangle.Y = (value >> 8) * squareSize - viewportY;
rectangle.X = (value & 0xFF) * squareSize - viewportX;
if (_charactersControl.CurrentAdditionalIndices.Contains(i))
target2D.FillRectangle(rectangle, _selectedColorBrush);
else if (source.Chars[i + 256] == 0x00)
target2D.FillRectangle(rectangle, _notMappedColorBrush);
else
target2D.DrawRectangle(rectangle, _gridColorBrush, 1.0f);
}
target2D.EndDraw();
}