I tried as you said. It created a bmp file. But when i open it there
was no image. It was just an empty bmp file
When i tried to open it
with paint it said format not supported
this is my code
public void drawwire(Graphics gr)
{
Pen p1 = new Pen(System.Drawing.Color.Black, 6);
Color customColor = Color.Black;
SolidBrush b1 = new SolidBrush(customColor);
Point begin = new Point(), end = new Point();
for (int count1 = 1; count1 <= wire_cont; count1++)
{
if (modify.item == 1)
{
p1.Color = Color.Black;
b1.Color = Color.Black;
if (modify.no == count1)
{
p1.Color = Color.Red;
b1.Color = Color.Red;
}
}
if (wire[count1] != null)
{
begin = wire[count1].getBeginning();
end = wire[count1].getEnding();
gr.FillRectangle(b1, begin.X - 4, begin.Y - 4, 8,
8);
gr.FillRectangle(b1, end.X - 4, end.Y - 4, 8, 8);
gr.DrawLine(p1, begin, end);
}
}
}
private void toolStripButton2_Click(object sender, EventArgs e)
{
Bitmap print = new Bitmap(100, 100);
using (Graphics pri = Graphics.FromImage(print))
{
drawwire(pri);
}
print.Save("E:\\print.bmp");
}