开发者

ASP.net create an image

Lost on this one, I've developed a drag and drop area.

I have:

A set of images with x,y width and height all known A set of text labels, all with x,y,fontsize,text etc all known

How can I convert this into an image file so I can开发者_高级运维 thumbnail it? Don't really know where to start.


Create a bitmap of the size you need, grab a graphics instance from it, and begin drawing.

Bitmap bmp = new Bitmap(height,width);
using gfx = Graphics.FromImage(bmp) {
  // then draw on the gfx instance, flush, and then save the bitmap.
  gfx.DrawString(...)//with your position information
  gfx.DrawImage(...)//with your position,font,text info
  gfx.Flush();
}
bmp.Save(...);


See my answer for the question below that contains code for generating thumbnails on the fly:

Alternatives to System.Drawing for use with ASP.NET?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜