当前位置: 首页>>代码示例>>C#>>正文


C# Graphics.ScaleTransform方法代码示例

本文整理汇总了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;
 }
开发者ID:kgroat,项目名称:Valor,代码行数:7,代码来源:ValorForm.cs

示例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);
        }
开发者ID:Elboodo,项目名称:My-FyiReporting,代码行数:34,代码来源:PageDrawing.cs

示例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);
 }
开发者ID:gremerritt,项目名称:CS.NET-Assignments,代码行数:8,代码来源:Form1.cs

示例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);
     }
 }
开发者ID:aabrohi,项目名称:kinect-kollage,代码行数:10,代码来源:ClusterLayer.cs

示例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);
		}	
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:11,代码来源:ExpandShape.cs

示例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);
		}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:11,代码来源:VectorShape.cs

示例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;
 }
开发者ID:0xwas,项目名称:LiveSplit.Graph,代码行数:11,代码来源:GraphComponent.cs

示例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);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:12,代码来源:FieldShape.cs

示例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);
        }
开发者ID:Caresilabs,项目名称:MAH_MultiThreading,代码行数:12,代码来源:Triangle.cs

示例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));
        }
开发者ID:GriefSyndromeModderTools,项目名称:GS_ActEdit,代码行数:12,代码来源:FormPreview.cs

示例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;
        }
开发者ID:pedgeon,项目名称:ORAN,代码行数:12,代码来源:Form1.cs

示例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>();
 }
开发者ID:kvngard,项目名称:convexHull,代码行数:13,代码来源:FormMain.cs

示例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);
    }
 }
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:16,代码来源:GMarkerArrow.cs

示例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);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:17,代码来源:CollapseExpandShape.cs

示例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();
 }
开发者ID:an83,项目名称:KinectTouch2,代码行数:18,代码来源:HandLayer.cs


注:本文中的System.Drawing.Graphics.ScaleTransform方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。