如何在创建自己的图表时使用缩放? [英] How Can I Use Scaling While Creating My Own Chart?

查看:104
本文介绍了如何在创建自己的图表时使用缩放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在表格和两条线相交的点上绘制了两条线和一条圆,我想使用缩放将该点作为中心。

我该怎么做?

以下是我绘制的两条线和圆圈。



 e.Graphics.DrawLine(Pens.Black,  186  210  471  210 
e.Graphics.DrawLine(Pens.Black, 330 82 330 348
e.Graphics。 DrawEllipse(Pens.Black, 210 100 240 220





两条线相交的点是330,210

解决方案

我不确定我理解你很好,但是...



如果你想操纵图形,你需要创建设备上下文。然后你就可以操作这个图了。



看看这里:

缩放图像 [ ^ ]

< a href =http://msdn.microsoft.com/en-us/library/hf85w92t%28v=vs.90%29.aspx> .NET Compact Framework中的图形和绘图 [ ^ ]

Graphics.ScaleTransform Method [ ^ ]

位图,设备上下文和绘图表面 [ ^ ]

关于设备上下文 [ ^ ]

Graphics.GetHdc方法 [ ^ ]

如何:创建缩放效果 [ ^ ]



更多:

如何:裁剪和缩放图像 [ ^ ]

如何:使用插值模式在缩放期间控制图像质量 [ ^ ]

Windows窗体中的自动缩放 [ ^ ]

I have drawn two lines and a circle on the form and on the point where two lines intersect i want to use scaling taking that point as center.
How can i do this?
Here are the two lines and circles i have drawn.

e.Graphics.DrawLine(Pens.Black, 186, 210, 471, 210)
    e.Graphics.DrawLine(Pens.Black, 330, 82, 330, 348)
    e.Graphics.DrawEllipse(Pens.Black, 210, 100, 240, 220)



The point where two lines are intersecting are 330,210

解决方案

I'm not sure i understand you well, but...

If you want to manipulate graphic, you need to create device context. Then you'll be able to manipulate this graphic.

Have a look here:
Scaling an Image[^]
Graphics and Drawing in the .NET Compact Framework[^]
Graphics.ScaleTransform Method [^]
Bitmaps, Device Contexts, and Drawing Surfaces[^]
About Device Contexts[^]
Graphics.GetHdc Method[^]
How to: Create a Zoom Effect[^]

More:
How to: Crop and Scale Images[^]
How to: Use Interpolation Mode to Control Image Quality During Scaling[^]
Automatic Scaling in Windows Forms[^]


这篇关于如何在创建自己的图表时使用缩放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆