2

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.

hometoast
  • 10,977
  • 4
  • 37
  • 57
Tom Gullen
  • 56,187
  • 79
  • 269
  • 433

2 Answers2

1

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(...);
hometoast
  • 10,977
  • 4
  • 37
  • 57
1

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?

Community
  • 1
  • 1
rick schott
  • 20,815
  • 5
  • 50
  • 79