protected void ASPxBinaryImage1_Ini object sender EventArgs ASPxBinary

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
protected void ASPxBinaryImage1_Init(object sender, EventArgs e) {
ASPxBinaryImage biControl = (ASPxBinaryImage)sender;
//GridViewDataItemTemplateContainer container = (GridViewDataItemTemplateContainer)biControl.NamingContainer;
AreaSparklineView view = new AreaSparklineView();
view.Color = Color.Red;
SparklinePaintersCache paintersCache = new SparklinePaintersCache();
BaseSparklinePainter painter = paintersCache.GetPainter(view);
Bitmap bitmap = new Bitmap(200, 200);
Graphics graphics = Graphics.FromImage(bitmap);
painter.Draw(graphics, null);
ImageConverter converter = new ImageConverter();
biControl.ContentBytes = (byte[])converter.ConvertTo(bitmap, typeof(byte[]));
}