本文整理汇总了C#中System.Drawing.Graphics.ScaleTransform方法的典型用法代码示例。如果您正苦于以下问题:C# Graphics.ScaleTransform方法的具体用法?C# Graphics.ScaleTransform怎么用?C# Graphics.ScaleTransform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.ScaleTransform方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitGraphics
private static void InitGraphics(Graphics g)
{
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
g.ScaleTransform(ValorEngine.Scale, ValorEngine.Scale);
g.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;
g.PageUnit = GraphicsUnit.Pixel;
}
示例2: Draw
/// <summary>
/// Draw- simple draw of an entire page. Useful when printing or creating an image.
/// </summary>
/// <param name="g"></param>
/// <param name="page"></param>
/// <param name="clipRectangle"></param>
public void Draw(Graphics g, int page, System.Drawing.Rectangle clipRectangle, bool drawBackground, PointF pageOffset)
{
DpiX = g.DpiX; // this can change (e.g. printing graphics context)
DpiY = g.DpiY;
// g.InterpolationMode = InterpolationMode.HighQualityBilinear; // try to unfuzz charts
g.PageUnit = GraphicsUnit.Pixel;
g.ScaleTransform(1, 1);
if (!pageOffset.IsEmpty) // used when correcting for non-printable area on paper
{
g.TranslateTransform(pageOffset.X, pageOffset.Y);
}
_left = 0;
_top = 0;
_hScroll = 0;
_vScroll = 0;
RectangleF r = new RectangleF(clipRectangle.X, clipRectangle.Y,
clipRectangle.Width, clipRectangle.Height);
if (drawBackground)
g.FillRectangle(Brushes.White, PixelsX(_left), PixelsY(_top),
PixelsX(_pgs.PageWidth), PixelsY(_pgs.PageHeight));
ProcessPage(g, _pgs[page], r, false);
}
示例3: ApplyTransform
private void ApplyTransform(Graphics g)
{
scale = Math.Min(ClientRectangle.Width / clientSize,
ClientRectangle.Height / clientSize);
if (scale == 0f) return;
g.ScaleTransform(scale, scale);
g.TranslateTransform(offset, offset);
}
示例4: Paint
public override void Paint(Graphics g)
{
g.ScaleTransform(this.zoomFactor, this.zoomFactor);
var brushSwitcher = new BrushSwitcher();
foreach (var cluster in this.dataSource.CurrentValue.Clusters)
{
this.DrawClusterPoints(cluster, g, brushSwitcher.GetNext());
this.DrawCenter(cluster, g);
}
}
示例5: Draw
public override void Draw(Graphics graphics)
{
if (graphics == null) return;
CollapseShape.DrawButton(graphics);
graphics.TranslateTransform(1, 23);
graphics.ScaleTransform(1, -1);
CollapseShape.DrawArrow(graphics);
graphics.TranslateTransform(0, 6);
CollapseShape.DrawArrow(graphics);
}
示例6: DrawToGraphics
public virtual void DrawToGraphics (Graphics graphics, float x, float y, float scaleX, float scaleY)
{
if (graphics == null) return;
GraphicsState state = graphics.Save();
graphics.TranslateTransform (x, y);
graphics.ScaleTransform(scaleX, scaleY);
Draw(graphics);
//graphics.DrawRectangle(Pens.Magenta, 0, 0, ShapeWidth, ShapeHeight);
graphics.Restore(state);
}
示例7: DrawGeneral
private void DrawGeneral(Graphics g, LiveSplitState state, float width, float height)
{
var oldMatrix = g.Transform;
if (Settings.FlipGraph)
{
g.ScaleTransform(1, -1);
g.TranslateTransform(0, -height);
}
DrawGraph(g, state, width, height);
g.Transform = oldMatrix;
}
示例8: Draw
public override void Draw(Graphics graphics)
{
if (graphics == null) return;
GraphicsState state = graphics.Save();
graphics.TranslateTransform(17.0f, 0.0f);
graphics.ScaleTransform(-1.0f, 1.0f);
MethodShape.DrawBrick(graphics, brickBrush1, brickBrush2, brickBrush3);
graphics.Restore(state);
graphics.FillRectangle(Brushes.Gray, 1.0f, 4.5f, 3.5f, 0.5f);
graphics.FillRectangle(Brushes.Gray, 0.0f, 6.5f, 3.5f, 0.5f);
graphics.FillRectangle(Brushes.Gray, 2.0f, 8.5f, 3.5f, 0.5f);
}
示例9: Draw
public void Draw(Graphics g)
{
g.ResetTransform();
g.ScaleTransform(1 + (float)Math.Cos(angle/200f)/1f, 1+ (float)Math.Cos(angle/200f)/1f);
g.TranslateTransform(g.VisibleClipBounds.Width / 2f, g.VisibleClipBounds.Height / 2f);
angle += 10;
g.RotateTransform(angle);
g.DrawPolygon(new Pen(new SolidBrush(Color.Black), 3), vertices);
}
示例10: DrawElement
private void DrawElement(Graphics g, Act2DMapLayoutObject.Element e)
{
var bitmap = file.CreateBitmapForResource(e.resourceID);
if (bitmap == null) return;
g.TranslateTransform(e.x, e.y);
g.TranslateTransform(bitmap.Width * 0.5f, bitmap.Height * 0.5f);
g.RotateTransform(e.rotate);
g.ScaleTransform(e.scale_x, e.scale_y);
g.TranslateTransform(-bitmap.Width * 0.5f, -bitmap.Height * 0.5f);
g.DrawImage(bitmap, new PointF(0.0f, 0.0f));
}
示例11: TestDraw
private void TestDraw(Graphics g, bool flip, bool rotate)
{
Matrix matrix = g.Transform;
if (flip) g.ScaleTransform(1, -1);
if (rotate) g.RotateTransform(90);
g.DrawRectangle(Pens.Red, 16, 32, 100, 40);
g.DrawString("Testing 1234567890", Font, Brushes.Red, 24, 48);
g.Transform = matrix;
}
示例12: FormMain
public FormMain()
{
InitializeComponent();
pictureBoxView.Image = new Bitmap(pictureBoxView.Width, pictureBoxView.Height);
m_g = Graphics.FromImage(pictureBoxView.Image);
m_g.TranslateTransform(0, pictureBoxView.Height);
m_g.ScaleTransform(1, -1);
pictureBoxView.Image.RotateFlip(RotateFlipType.Rotate180FlipX);
pointGenerator = new UniformPointGenerator();
radioUniform.Checked = true; //start with this as the default
m_pointList = new List<PointF>();
UniquePoints = new Dictionary<float, PointF>();
}
示例13: OnRender
public override void OnRender(Graphics g)
{
//g.DrawRectangle(Pen, new System.Drawing.Rectangle(LocalPosition.X, LocalPosition.Y, Size.Width, Size.Height));
{
g.TranslateTransform(ToolTipPosition.X, ToolTipPosition.Y);
var c = g.BeginContainer();
{
g.RotateTransform(Bearing - Overlay.Control.Bearing);
g.ScaleTransform(Scale, Scale);
g.FillPolygon(Fill, Arrow);
}
g.EndContainer(c);
g.TranslateTransform(-ToolTipPosition.X, -ToolTipPosition.Y);
}
}
示例14: Draw
public override void Draw(Graphics graphics)
{
if (graphics == null) return;
GraphicsState state = graphics.Save();
CollapseExpandShape.DrawButton(graphics);
if (collapsed)
{
graphics.TranslateTransform(0, 21);
graphics.ScaleTransform(1, -1);
}
CollapseExpandShape.DrawArrow(graphics);
graphics.TranslateTransform(0, 6);
CollapseExpandShape.DrawArrow(graphics);
graphics.Restore(state);
}
示例15: PaintHand
private void PaintHand(Graphics g, HandData hand)
{
g.TranslateTransform(hand.Location.X * this.zoomFactor, hand.Location.Y * this.zoomFactor);
g.ScaleTransform(this.zoomHandFactor, this.zoomHandFactor);
g.TranslateTransform(-hand.Location.X * this.zoomFactor, -hand.Location.Y * this.zoomFactor);
g.ScaleTransform(this.zoomFactor, this.zoomFactor);
if (this.ShowConvexHull)
{
this.PaintCovexHull(hand, g);
}
if (this.ShowContour && hand.Contour != null)
{
this.PaintContour(hand, g);
}
DrawFingerPoints(hand, g);
this.DrawCenter(hand, g);
g.ResetTransform();
}