Hi
I have been reading the documantation on how to add images to an Infragistics.Document - seems basically straight forwards, but...
How do I read the image from a file (or maybe from an UltraPictureBox.Image), resize in memory, and place on the document?
Thanks for your help
You could read in the image as a bitmap (the constructor has an overload that takes a file name), then draw that image into a new Bitmap:
public Bitmap ResizeBitmap(Bitmap b, int nWidth, int nHeight){ Bitmap result = new Bitmap(nWidth, nHeight); using (Graphics g = Graphics.FromImage((Image)result)) g.DrawImage(b, 0, 0, nWidth, nHeight); return result;}
You would then add it to the document through whichever element you're using, such as:
section.AddImage(new Infragistics.Documents.Graphics.Image(bmp));
-Matt
Matt
Magnificant!
Thanks very much
Jerry