Glossary Item Box
You can use next way to initialize image in BinaryImage control using any stream:
protected void BinaryImage1_ShowImage(object sender, AspLib.WebControls.ShowedImageArgs e)
{
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(200, 50);
System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp);
g.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.Yellow), 0, 0, 199, 49);
g.DrawString(DateTime.Now.ToString(), new System.Drawing.Font("Arial", 10),
new System.Drawing.SolidBrush(System.Drawing.Color.Red), 10, 10);
MemoryStream stream = new MemoryStream();
oBitmap.Save(stream, "image/jpeg");
e.Image = stream.ToArray();
}
| See Also |
Overview: Overview
Controls: Binary Image