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
  • 11,293
  • 4
  • 39
  • 57
Tom Gullen
  • 59,517
  • 82
  • 274
  • 446

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
  • 11,293
  • 4
  • 39
  • 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,915
  • 5
  • 51
  • 80