Graphics.DrawImage 方法 (Image, Rectangle) [Visual Basic]请参见
Graphics 类 | Graphics 成员 | System.Drawing 命名空间 | Graphics.DrawImage 重载列表
要求
平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family
语言
C#C++JScriptVisual Basic全部显示
在指定位置并且按指定大小绘制指定的 Image 对象。[Visual Basic]
<ComVisible(False)>
Overloads Public Sub DrawImage( _
ByVal image As Image, _
ByVal rect As Rectangle _
)
[C#]
[ComVisible(false)]
public void DrawImage(
Image image,
Rectangle rect
);
[C++]
[ComVisible(false)]
public: void DrawImage(
Image* image,
Rectangle rect
);
[JScript]
public
ComVisible(false)
function DrawImage(
image : Image,
rect : Rectangle
);
参数
image
要绘制的 Image 对象。
rect
Rectangle 结构,它指定所绘制图像的位置和大小。
Graphics 类 | Graphics 成员 | System.Drawing 命名空间 | Graphics.DrawImage 重载列表
要求
平台: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family
语言
C#C++JScriptVisual Basic全部显示
在指定位置并且按指定大小绘制指定的 Image 对象。[Visual Basic]
<ComVisible(False)>
Overloads Public Sub DrawImage( _
ByVal image As Image, _
ByVal rect As Rectangle _
)
[C#]
[ComVisible(false)]
public void DrawImage(
Image image,
Rectangle rect
);
[C++]
[ComVisible(false)]
public: void DrawImage(
Image* image,
Rectangle rect
);
[JScript]
public
ComVisible(false)
function DrawImage(
image : Image,
rect : Rectangle
);
参数
image
要绘制的 Image 对象。
rect
Rectangle 结构,它指定所绘制图像的位置和大小。
width是宽度缩放因子,height是高度缩放因子,它们可以
通过用窗口客户区的Width和Height属性分别除以bmp的Width和
Height属性的得到.大概思路就是这样,具体实现自己想
using System.Drawing;
using System.Windows.Forms;public class Form1 : Form
{
Bitmap image; public Form1()
{
ResizeRedraw = true;
} protected override void OnPaint(PaintEventArgs pea)
{
image = new Bitmap(@"E:\SOURCE\C#\12345.jpg");
Graphics grfx = pea.Graphics;
SizeF sizef = grfx.VisibleClipBounds.Size;
grfx.DrawImage(image, 0, 0, (int)sizef.Width, (int)sizef.Height);
} public static void Main()
{
Application.Run(new Form1());
}
}
有没这方面的资料研究一下!
不需要ScaleTransform
里面有关于这方面的资料,一章~
还望大家不吝赐教!Bitmap bmp = new Bitmap(200,200);
Graphics g1= Graphics.FromImage(bmp);
画图语句
p1.Image =bmp;
p1 //pictureBox
然后我想完成这些 放大,缩小,旋转,平移 功能,希望大家能给点意见与例子。谁帮我找到好的方案,我另加贴子单独送分200。
参考一下这个吧
我要睡觉了,明天还要早读,呜呜~~