step1: Use image object to read your picture; step2: Create graphic object by image object; step3: Draw lines or other using graphic object and save it step4: Show the new image
Knight94(愚翁) ( ):烦您给出代码好吗,好急的!
Knight94(愚翁) ( )烦您老给出代码好吗,好急的!
Bitmap myBitmap = new Bitmap(@"C:\Documents and Settings\Joe\Pics\myPic.bmp"); Graphics g = Graphics.FromImage(myBitmap); g.DrawArc(pen,fCenterX+x,fCenterY+y,width,height,startAngle,sweepAngle-startAngle); pictureBox1.Image=
金质打印通快有这些功能 了,哈哈
g.DrawArc(pen,fCenterX+x,fCenterY+y,width,height,startAngle,sweepAngle-startAngle);
在代码
g=pictureBox1.CreateGraphics();
g.DrawArc(pen,fCenterX+x,fCenterY+y,width,height,startAngle,sweepAngle-startAngle);
中,固定的图片列如地图是不是放在pictureBox1中?而且我说的是要在 web窗体 中输出哟!
step2: Create graphic object by image object;
step3: Draw lines or other using graphic object and save it
step4: Show the new image
Bitmap myBitmap = new Bitmap(@"C:\Documents and
Settings\Joe\Pics\myPic.bmp");
Graphics g = Graphics.FromImage(myBitmap);
g.DrawArc(pen,fCenterX+x,fCenterY+y,width,height,startAngle,sweepAngle-startAngle);
pictureBox1.Image=
// Create graphics object for alteration.
Graphics newGraphics = Graphics.FromImage(imageFile);
// Alter image.
newGraphics.FillRectangle(new SolidBrush(Color.Coral), 50, 50, 100, 100); // Draw image to screen.
imgTest.ImageUrl = @"Images\SampImag.jpg";
// Release graphics object.
newGraphics.Dispose();
string strFileName = Server.MapPath("Images/SampImag.jpg"); // Create image.
System.Drawing.Image imageFile = System.Drawing.Image.FromFile(strFileName);
// Create graphics object for alteration.
Graphics newGraphics = Graphics.FromImage(imageFile);
// Alter image.
newGraphics.FillRectangle(new SolidBrush(Color.Coral), 50, 50, 100, 100);
strFileName = Server.MapPath( "Images" ) + "\NewImag.jpg";
imageFile.Save( strFileName); // Draw image to screen.
imgTest.ImageUrl = @"Images\NewImag.jpg";
// Release graphics object.
newGraphics.Dispose();
目录Images是在你的web虚拟目录下;然后在系统中设置这个目录能对aspnet用户可写。
否则上面的程序无法成功。