GENERATING .DWG FILE BY A C# CODE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm editing a image, loading it in a pictureBox. When i've done the changes i want to save the image as a .dwg file, but when i want to open the file AUTOCAD doesnt recognise so i'm not able to open the file on AUTOCAD. Is there any way which i can obtain a correct .dwg file, from a edited image in c#?
This is the code that i'm using to obtain the .dwg file, it works for jpg file, but not for .dwg file
private void Generar_Click(object sender, EventArgs e)
{
SaveFileDialog Guardar = new SaveFileDialog();
Guardar.Filter = "DWG(*.dwg)|*DWG|DXG(*.DXG)|*.DXG|JPEG(*.JPG)|*.JPG|BMP(*.BMP)|*.BMP";
Bitmap bmp = new Bitmap(pictureBox.Image);
Graphics gr = Graphics.FromImage(bmp);
Pen p = new Pen(Color.Red);
p.Width = 5.0f;
gr.DrawRectangle(p, 1, 2, 30, 40);
pictureBox.Image = bmp;
Image Imagen = pictureBox.Image;
Guardar.ShowDialog();
Imagen.Save(Guardar.FileName);
}
Thanks