I am using System.Web.UI.DataVisualization.Charting library to generate column chart in c#. But I want to remove x and y axis. want only the bars. I remover grid lines using following code
chart.ChartAreas[0].AxisX.MajorGrid.Enabled = false;
chart.ChartAreas[0].AxisY.MajorGrid.Enabled = false;
How can I remove axis lines and its values ?
var chart = new Chart
{
Width = 80,
Height = 125,
RenderType = RenderType.ImageTag,
AntiAliasing = AntiAliasingStyles.All,
TextAntiAliasingQuality = TextAntiAliasingQuality.High
};
chart.Titles.Add("50");
chart.Titles.Add("Strongly Disagree");
chart.Titles[0].Font = new Font("Arial", 8f,FontStyle.Bold);
chart.Titles[0].ForeColor = Color.DarkGray;
chart.Titles[1].Font = new Font("Arial", 7f);
chart.Titles[1].ForeColor = Color.DarkGray;
chart.Titles[0].Position.X = 50;
chart.Titles[0].Position.Y = 50;
chart.Titles[1].Position.X = 50;
chart.Titles[1].Position.Y = 90;
chart.ChartAreas.Add("");
chart.ChartAreas[0].AxisX.TitleFont = new Font("Arial", 12f);
chart.ChartAreas[0].AxisY.TitleFont = new Font("Arial", 12f);
chart.ChartAreas[0].AxisX.LabelStyle.Font = new Font("Arial", 10f);
chart.ChartAreas[0].AxisX.LabelStyle.Angle = -90;
chart.ChartAreas[0].BackColor = Color.White;
chart.ChartAreas[0].AxisX.MajorGrid.Enabled = false;
chart.ChartAreas[0].AxisY.MajorGrid.Enabled = false;
chart.Series.Add("");
chart.Series[0].ChartType = SeriesChartType.Column;
int i = 0;
foreach (var q in myOrderList)
{
if (i == 0)
{
chart.Series[0].Points.AddXY("", Convert.ToDouble(q.NumberOfOrders));
chart.Series[0].Points[0].Color = Color.Orchid;
}
else
{
chart.Series[0].Points.AddXY("", Convert.ToDouble(q.NumberOfOrders));
chart.Series[0].Points[1].Color = Color.DarkViolet;
}
i++;
}
using (var chartimage = new MemoryStream())
{
chart.SaveImage(chartimage, ChartImageFormat.Png);
return chartimage.GetBuffer();
}
I found the solution..
chart.ChartAreas[0].AxisX.MinorGrid.Enabled = false;
chart.ChartAreas[0].AxisX.MajorTickMark.Enabled = false;
chart.ChartAreas[0].AxisX.MinorTickMark.Enabled = false;
chart.ChartAreas[0].AxisX.Interval = 0;
chart.ChartAreas[0].AxisX.LabelStyle.ForeColor = Color.White;
chart.ChartAreas[0].AxisY.LabelStyle.Enabled = false;
chart.ChartAreas[0].AxisY.MajorTickMark.Enabled = false;
chart.ChartAreas[0].AxisY.MinorTickMark.Enabled = false;
chart.ChartAreas[0].AxisX.LineWidth = 0;
chart.ChartAreas[0].AxisY.LineWidth = 0;
Related
I am using Spire.PDF library to create a PDF in server side and return it to mobile side. Everything is working great. But I wanna access to each cell's border in the grid. I wanna change the color of the border.
https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/Table/How-to-Change-the-Color-of-Grid-Border-in-PDF-in-C.html
Current code..
public HttpResponseMessage GET_MOTOR_RENWAL_PDF()
{
AgentDAL agntDAL = new AgentDAL();
//Create a pdf document.
PdfDocument doc = new PdfDocument();
PdfSection sec = doc.Sections.Add();
sec.PageSettings.Width = PdfPageSize.A4.Width;
sec.PageSettings.Height = PdfPageSize.A4.Height;
sec.PageSettings.Margins = new PdfMargins(20f, 5f, 20f, 5f);
PdfPageBase page = sec.Pages.Add();
//title
PdfBrush brush1 = PdfBrushes.Black;
PdfTrueTypeFont font1 = new PdfTrueTypeFont(new Font("Times New Roman", 11f, FontStyle.Bold));
PdfStringFormat format1 = new PdfStringFormat(PdfTextAlignment.Center);
page.Canvas.DrawString("Monthly", font1, brush1, page.Canvas.ClientSize.Width / 2, 60, format1);
page.Canvas.DrawString("Report generated", font1, brush1, page.Canvas.ClientSize.Width / 2, 76, format1);
//grid
PdfGrid grid = new PdfGrid();
grid.Columns.Add(5);
float gridWidth = page.Canvas.ClientSize.Width - (grid.Columns.Count + 1);
for (int j = 0; j < grid.Columns.Count; j++)
{
grid.Columns[j].Width = gridWidth * 0.20f;
}
PdfGridRow row0 = grid.Rows.Add();
PdfGridRow row1 = grid.Rows.Add();
PdfGridRow row2 = grid.Rows.Add();
PdfGridRow row3 = grid.Rows.Add();
row0.Style.Font = new PdfTrueTypeFont(new Font("Times New Roman", 11f, FontStyle.Regular), true);
row1.Style.Font = new PdfTrueTypeFont(new Font("Times New Roman", 11f, FontStyle.Regular), true);
row2.Style.Font = new PdfTrueTypeFont(new Font("Times New Roman", 11f, FontStyle.Regular), true);
row3.Style.Font = new PdfTrueTypeFont(new Font("Times New Roman", 11f, FontStyle.Regular), true);
row0.Cells[2].ColumnSpan = 3;
row1.Cells[2].ColumnSpan = 3;
row2.Cells[2].ColumnSpan = 3;
row3.Cells[2].ColumnSpan = 3;
row0.Cells[2].RowSpan = 4;
row0.Cells[0].Value = "Policy";
row0.Cells[1].Value = "VM5115001510000009";
row1.Cells[0].Value = "Vehicle";
row1.Cells[1].Value = "BBP";
row2.Cells[0].Value = "Premium";
row2.Cells[1].Value = "7,366.10";
row3.Cells[0].Value = "Date";
row3.Cells[1].Value = "03-Jan-2020";
float gridHeight = 20.0f;
for (int i = 0; i < grid.Rows.Count; i++)
{
grid.Rows[i].Height = gridHeight;
}
grid.Draw(page, new PointF(0, 120));
MemoryStream stream = new MemoryStream();
doc.SaveToStream(stream);
HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
result.Content = new ByteArrayContent(stream.ToArray());
result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
doc.Close();
return result;
}
What I get from this...
What I want...
I tried to do this, but it didn't work.
row0.Cells[0].Style.Borders.Right.Color = Color.DarkRed;
row1.Cells[0].Style.Borders.Right.Color = Color.DarkRed;
row2.Cells[0].Style.Borders.Right.Color = Color.DarkRed;
row3.Cells[0].Style.Borders.Right.Color = Color.DarkRed;
Try the below code:
float gridHeight = 20.0f;
for (int i = 0; i < grid.Rows.Count; i++)
{
grid.Rows[i].Height = gridHeight;
grid.Rows[i].Cells[0].Style.Borders.Right = new PdfPen(PdfBrushes.DarkRed);
grid.Rows[i].Cells[1].Style.Borders.Left = new PdfPen(PdfBrushes.DarkRed);
}
I have a robot that outputs x,y,z position in space. My problem is that I can only find 2D plot in windows forms using chart.
I want to plot my robot in 3D space. Any tools I can use??
Something similar to this:
I need a free software solution for this
EDIT:
My 2D graph atm:
chart1.ChartAreas[0].AxisX.Minimum = 0;
chart1.ChartAreas[0].AxisX.Maximum = 12;
chart1.ChartAreas[0].AxisX.Interval = 1;
chart1.ChartAreas[0].AxisY.Minimum = 0;
chart1.ChartAreas[0].AxisY.Maximum = 7;
chart1.ChartAreas[0].AxisY.Interval = 1;
//example
posicao_atual_master.X = 10;
posicao_atual_master.Y = 5;
chart1.Series[0].Points.Clear();
chart1.Series[0].Points.AddXY(posicao_atual_master.X, posicao_atual_master.Y);
DESIGNER:
// chart1
//
chartArea1.AxisX.MajorGrid.Enabled = false;
chartArea1.AxisX.MajorTickMark.Enabled = false;
chartArea1.AxisY.MajorGrid.Enabled = false;
chartArea1.AxisY.MajorTickMark.Enabled = false;
chartArea1.Name = "ChartArea1";
chartArea1.Position.Auto = false;
chartArea1.Position.Height = 100F;
chartArea1.Position.Width = 90F;
this.chart1.ChartAreas.Add(chartArea1);
legend1.BackColor = System.Drawing.Color.Transparent;
legend1.BorderColor = System.Drawing.Color.Transparent;
legend1.Font = new System.Drawing.Font("Microsoft Sans Serif", 4F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Millimeter, ((byte)(1)), true);
legend1.IsTextAutoFit = false;
legend1.Name = "legen";
legend1.TableStyle = System.Windows.Forms.DataVisualization.Charting.LegendTableStyle.Tall;
this.chart1.Legends.Add(legend1);
this.chart1.Location = new System.Drawing.Point(543, 49);
this.chart1.Name = "chart1";
series1.ChartArea = "ChartArea1";
series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
series1.Color = System.Drawing.Color.Transparent;
series1.Legend = "legen";
series1.MarkerBorderColor = System.Drawing.Color.Black;
series1.MarkerImage = "C:\\Users\\Tiago\\Desktop\\CODIGO_TESE_FINAL_BACKUP1408_BOM\\C# - AR.Drone SDK\\AR.Dron" +
"e\\icone_drone_verde.png";
series1.MarkerImageTransparentColor = System.Drawing.Color.Red;
series1.Name = "Master";
series2.ChartArea = "ChartArea1";
series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;
series2.Legend = "legen";
series2.MarkerImage = "C:\\Users\\Tiago\\Desktop\\CODIGO_TESE_FINAL_BACKUP1408_BOM\\Fotos dos Relatórios\\icon" +
"e_drone_vermelho.png";
series2.Name = "Slave";
this.chart1.Series.Add(series1);
this.chart1.Series.Add(series2);
this.chart1.Size = new System.Drawing.Size(1159, 359);
this.chart1.TabIndex = 7;
this.chart1.Text = "chart1";
this.chart1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.chart1_MouseDown);
this.chart1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.chart1_MouseMove);
this.chart1.MouseUp += new System.Windows.Forms.MouseEventHandler(this.chart1_MouseUp);
EDIT: IMAGE
You are correct, there is no proper way to use a real z-axis in the Chart control.
It does have a 3D style though, which can be used for a reasonably nice ChartArea.
You will have to do the painting of the graph in code though, as the built-in z-axis only support as many, or rather as few discret values as you have Series in the chart.
This is ok for some things, like a color cube, but when you need arbitryry data values it just won't do.
Instead you can do this:
Store the z-value of each DataPoint along with the Y-value in the YValues array.
For this you need a ChartType that supports several YValues
Code one of the xxxPaint events to draw the graphics
For this you need a conversion from values to pixels
First we prepare the chart. Many details are up to your needs;
void prepare3dChart(Chart chart, ChartArea ca)
{
ca.Area3DStyle.Enable3D = true; // set the chartarea to 3D!
ca.AxisX.Minimum = -250;
ca.AxisY.Minimum = -250;
ca.AxisX.Maximum = 250;
ca.AxisY.Maximum = 250;
ca.AxisX.Interval = 50;
ca.AxisY.Interval = 50;
ca.AxisX.Title = "X-Achse";
ca.AxisY.Title = "Y-Achse";
ca.AxisX.MajorGrid.Interval = 250;
ca.AxisY.MajorGrid.Interval = 250;
ca.AxisX.MinorGrid.Enabled = true;
ca.AxisY.MinorGrid.Enabled = true;
ca.AxisX.MinorGrid.Interval = 50;
ca.AxisY.MinorGrid.Interval = 50;
ca.AxisX.MinorGrid.LineColor = Color.LightSlateGray;
ca.AxisY.MinorGrid.LineColor = Color.LightSlateGray;
// we add two series:
chart.Series.Clear();
for (int i = 0; i < 2; i++)
{
Series s = chart.Series.Add("S" + i.ToString("00"));
s.ChartType = SeriesChartType.Bubble; // this ChartType has a YValue array
s.MarkerStyle = MarkerStyle.Circle;
s["PixelPointWidth"] = "100";
s["PixelPointGapDepth"] = "1";
}
chart.ApplyPaletteColors();
addTestData(chart);
}
Here we add some test data:
void addTestData(Chart chart)
{
Random rnd = new Random(9);
for (int i = 0; i < 100; i++)
{
double x = Math.Cos(i/10f )*88 + rnd.Next(5);
double y = Math.Sin(i/11f)*88 + rnd.Next(5);
double z = Math.Sqrt(i*2f)*88 + rnd.Next(5);
AddXY3d( chart.Series[0], x, y, z);
AddXY3d( chart.Series[1], x-111, y-222, z);
}
}
The DataPoints are added with this routine:
int AddXY3d(Series s, double xVal, double yVal, double zVal)
{
int p = s.Points.AddXY(xVal, yVal, zVal);
// the DataPoint are transparent to the regular chart drawing:
s.Points[p].Color = Color.Transparent;
return p;
}
If this Paint event we draw the data as we like it. Here are either Lines or Points:
private void chart1_PostPaint(object sender, ChartPaintEventArgs e)
{
Chart chart = sender as Chart;
if (chart .Series.Count < 1) return;
if (chart .Series[0].Points.Count < 1) return;
ChartArea ca = chart .ChartAreas[0];
e.ChartGraphics.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
List<List<PointF>> data = new List<List<PointF>>();
foreach (Series s in chart .Series)
data.Add(GetPointsFrom3D(ca, s, s.Points.ToList(), e.ChartGraphics));
renderLines(data, e.ChartGraphics.Graphics, chart , true); // pick one!
renderPoints(data, e.ChartGraphics.Graphics, chart , 6); // pick one!
}
The coodinates are calculated using axis methods:
List<PointF> GetPointsFrom3D(ChartArea ca, Series s,
List<DataPoint> dPoints, ChartGraphics cg)
{
var p3t = dPoints.Select(x => new Point3D((float)ca.AxisX.ValueToPosition(x.XValue),
(float)ca.AxisY.ValueToPosition(x.YValues[0]),
(float)ca.AxisY.ValueToPosition(x.YValues[1]))).ToArray();
ca.TransformPoints(p3t.ToArray());
return p3t.Select(x => cg.GetAbsolutePoint(new PointF(x.X, x.Y))).ToList();
}
The actual drawing happens in these routines; one draws lines the other dots:
void renderLines(List<List<PointF>> data, Graphics graphics, Chart chart, bool curves)
{
for (int i = 0; i < chart.Series.Count; i++)
{
if (data[i].Count > 1)
using (Pen pen = new Pen(Color.FromArgb(64, chart.Series[i].Color), 2.5f))
if (curves) graphics.DrawCurve(pen, data[i].ToArray());
else graphics.DrawLines(pen, data[i].ToArray());
}
}
void renderPoints(List<List<PointF>> data, Graphics graphics, Chart chart, float width)
{
for (int s = 0; s < chart.Series.Count; s++)
{
Series S = chart.Series[s];
for (int p = 0; p < S.Points.Count; p++)
using (SolidBrush brush = new SolidBrush(Color.FromArgb(64, S.Color)))
graphics.FillEllipse(brush, data[s][p].X-width/2,
data[s][p].Y-width/2,width, width);
}
}
Other drawing routines like meshes or areas can be coded just as well.. Simply add new routines using user GDI+ methods like DrawCurve or FillPolygon or maybe even DrawImage..
You can set the ChartArea.Area3DStyle.Rotation and the ChartArea.Area3DStyle.Inclination for different views, as can be seen in the animation.
Edit I have update the PostPaint method to minimze dependencies.
I am using System.Web.UI.DataVisualization.Charting to generate line chart which I am populating at run-time. Y axis of the graph is a percent value that currently scales from -150% to +150%. I want to adjust the scale so that Y Axis label will always scale from -100% to +100%. Any help is appreciated. Thank you.
This is the sample code i have for the chart:
Chart c = new Chart();
c.AntiAliasing = AntiAliasingStyles.All;
c.TextAntiAliasingQuality = TextAntiAliasingQuality.High;
c.Width = 800;
c.Height = 450;
ChartArea ca = new ChartArea();
ca.Position.X = 0;
ca.Position.Y = 10;
ca.Position.Width = 100;
ca.Position.Height = 80;
ca.BackColor = Color.FromArgb(248, 248, 248);
ca.BackSecondaryColor = Color.FromArgb(255, 255, 255);
ca.BackGradientStyle = GradientStyle.TopBottom;
ca.AxisY.IsMarksNextToAxis = true;
ca.AxisY.LineColor = Color.FromArgb(157, 157, 157);
ca.AxisY.MajorTickMark.Enabled = true;
ca.AxisY.MajorTickMark.LineColor = Color.FromArgb(157, 157, 157);
ca.AxisY.LabelStyle.ForeColor = Color.FromArgb(89, 89, 89);
ca.AxisY.LabelStyle.Format = "{0:p}";
ca.AxisY.LabelStyle.IsEndLabelVisible = true;
ca.AxisY.Interval = 1;
ca.AxisY.LabelStyle.Font = new Font("Calibri", 4, FontStyle.Regular);
ca.AxisY.MajorGrid.LineColor = Color.FromArgb(234, 234, 234);
ca.AxisX.IsMarksNextToAxis = true;
ca.AxisX.LineColor = Color.FromArgb(157, 157, 157);
ca.AxisX.MajorTickMark.Enabled = true;
ca.AxisX.MajorTickMark.LineColor = Color.FromArgb(157, 157, 157);
ca.AxisX.LabelStyle.IsEndLabelVisible = true;
ca.AxisX.LabelStyle.ForeColor = Color.FromArgb(89, 89, 89);
ca.AxisX.MajorGrid.LineWidth = 0;
ca.AxisX.IsMarginVisible = false;
ca.AxisX.Interval = 0;
c.ChartAreas.Add(ca);
List<RawData> rawData = (List<RawData>)rawDataDao.GetDataByDateRange(start.Value, end.Value);
if(rawData.Count > 0)
{
Series s = new Series();
s.Font = new Font("Lucida Sans Unicode", 6f);
s.Color = System.Drawing.ColorTranslator.FromHtml(GetCombinedColorByIndex(possibleSensors.IndexOf(sensor)));
s.BorderColor = Color.FromArgb(159, 27, 13);
s.BackSecondaryColor = Color.FromArgb(173, 32, 11);
s.BackGradientStyle = GradientStyle.LeftRight;
s.ChartType = SeriesChartType.Line;
s.XValueType = ChartValueType.DateTime;
s.Name = sensor.SensorName;
foreach (RawData d in workingRawData)
{
System.DateTime x = DateTime.Parse(d.Dt.Value.ToString("", CultureInfo.CreateSpecificCulture("en-US")));
DataPoint p = new DataPoint(x.ToOADate(), Convert.ToDouble(d.Reading));
p.AxisLabel = d.Dt.Value.ToString();
s.Points.Add(p);
}
c.Series.Add(s);
}
If the axis is zoomable, set the scaleview to the range you need
ca.AxisY.ScaleView.Zoom(-100, 100);
I'm trying to create chart programmatically. Here is code
static void Main(string[] args)
{
var xvals = new[]
{
new DateTime(2012, 4, 4),
new DateTime(2012, 4, 5),
new DateTime(2012, 4, 6),
new DateTime(2012, 4, 7)
};
var yvals = new[] { 1, 3, 7, 12 };
// create the chart
var chart = new Chart();
chart.Width = 600;
chart.Height = 350;
var chartArea = new ChartArea();
chartArea.AxisX.IsMarginVisible = false;
chartArea.AxisY.IsMarginVisible = false;
chartArea.AxisX.LabelStyle.Format = "dd";
chartArea.AxisX.MajorGrid.LineWidth = 0;
chartArea.AxisY.MajorGrid.LineWidth = 0;
chartArea.AxisY.LabelStyle.Font = new Font("Consolas", 8);
chartArea.AxisX.LabelStyle.Font = new Font("Consolas", 8);
chart.ChartAreas.Add(chartArea);
var series = new Series();
series.Name = "Series1";
series.ChartType = SeriesChartType.Line;
chart.Series.Add(series);
chart.Series["Series1"].Points.DataBindXY(xvals, yvals);
chart.SaveImage("chart.png", ChartImageFormat.Png);
}
I'm getting following output,
How can I remove Axis Lines both X and Y? So that my output will only the blue line.
chartArea.AxisY.LineWidth = 0;
chartArea.AxisX.LineWidth = 0;
chartArea.AxisX.LabelStyle.Enabled = false;
chartArea.AxisY.LabelStyle.Enabled = false;
chartArea.AxisX.MajorTickMark.Enabled = false;
chartArea.AxisY.MajorTickMark.Enabled = false;
Fixed my problem
How to use System.Windows.Forms.DataVisualization.Charting.Chart inside console application to draw an graph and save it to file?
//populate dataset with some demo data..
DataSet dataSet = new DataSet();
DataTable dt = new DataTable();
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Counter", typeof(int));
DataRow r1 = dt.NewRow();
r1[0] = "Demo";
r1[1] = 8;
dt.Rows.Add(r1);
DataRow r2 = dt.NewRow();
r2[0] = "Second";
r2[1] = 15;
dt.Rows.Add(r2);
dataSet.Tables.Add(dt);
//prepare chart control...
Chart chart = new Chart();
chart.DataSource = dataSet.Tables[0];
chart.Width = 600;
chart.Height = 350;
//create serie...
Series serie1 = new Series();
serie1.Name = "Serie1";
serie1.Color = Color.FromArgb(112, 255, 200);
serie1.BorderColor = Color.FromArgb(164, 164, 164);
serie1.ChartType = SeriesChartType.Column;
serie1.BorderDashStyle = ChartDashStyle.Solid;
serie1.BorderWidth = 1;
serie1.ShadowColor = Color.FromArgb(128, 128, 128);
serie1.ShadowOffset = 1;
serie1.IsValueShownAsLabel = true;
serie1.XValueMember = "Name";
serie1.YValueMembers = "Counter";
serie1.Font = new Font("Tahoma", 8.0f);
serie1.BackSecondaryColor = Color.FromArgb(0, 102, 153);
serie1.LabelForeColor = Color.FromArgb(100, 100, 100);
chart.Series.Add(serie1);
//create chartareas...
ChartArea ca = new ChartArea();
ca.Name = "ChartArea1";
ca.BackColor = Color.White;
ca.BorderColor = Color.FromArgb(26, 59, 105);
ca.BorderWidth = 0;
ca.BorderDashStyle = ChartDashStyle.Solid;
ca.AxisX = new Axis();
ca.AxisY = new Axis();
chart.ChartAreas.Add(ca);
//databind...
chart.DataBind();
//save result...
chart.SaveImage(#"c:\myChart.png", ChartImageFormat.Png);
Add this declaration on top of your class:
using System.Windows.Forms.DataVisualization.Charting;
Plot sin(x) between 0 and 2pi.
You have to add "System.Windows.Forms.DataVisualization.dll" and "System.Drawing.dll" to your project.
Good Luck :)
//
// chart
//
System.Windows.Forms.DataVisualization.Charting.Chart chart = new System.Windows.Forms.DataVisualization.Charting.Chart();
chart.Size = new System.Drawing.Size(640, 320);
chart.ChartAreas.Add("ChartArea1");
chart.Legends.Add("legend1");
// Plot {sin(x), 0, 2pi}
chart.Series.Add("sin");
chart.Series["sin"].LegendText = "Sin(x)";
chart.Series["sin"].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Spline;
for (double x = 0; x < 2 * Math.PI; x += 0.01)
{
chart.Series["sin"].Points.AddXY(x, Math.Sin(x));
}
// Save sin_0_2pi.png image file
chart.SaveImage("sin_0_2pi.png", System.Drawing.Imaging.ImageFormat.Png);