save
Moderators: SDS, support, admin
save
Hello,
it is possible to draw on a CADRasterImage but it seems not to be possible to save the drawing.
Is there any possiblity to save the CadRasterImage. We need to load / save the image as "project" so the customer can save the work and then continue. (All CADEntities and Images must be on the same position inside the Image)
I found the code for saveAsDXF, but it seems to exit if it's an CadRasterImage:
Is there another save method, or how can I save the Image,
Thank you,
Roman
it is possible to draw on a CADRasterImage but it seems not to be possible to save the drawing.
Is there any possiblity to save the CadRasterImage. We need to load / save the image as "project" so the customer can save the work and then continue. (All CADEntities and Images must be on the same position inside the Image)
I found the code for saveAsDXF, but it seems to exit if it's an CadRasterImage:
Code: Select all
private void miSaveAsDXF_Click(object sender, System.EventArgs e)
{
if(this.cadImage == null)
return;
if(this.saveDXFDlg.ShowDialog() != DialogResult.OK)
return;
SaveAsDXF(this.saveDXFDlg.FileName);
}
private void SaveAsDXF(string fName)
{
#region Export
#if Export
if(cadImage == null) return;
if(cadImage is CADRasterImage)
{
return;
}
CADImport.Export.DirectCADtoDXF.CADtoDXF vExp = new CADImport.Export.DirectCADtoDXF.CADtoDXF(cadImage);
vExp.SaveToFile(fName);
#else
MessageBox.Show("Not supported in current version!", "CAD .NET");
#endif
#endregion Export
}
Thank you,
Roman
Re: save
Hello Roman,
CADRasterImage object is intended for loading raster images and doesn't vectorize (convert to vector objects) the raster graphics. So, the DXF export doesn't make sense for the CADRasterImage. However, it is possible to save the CADRasterImage object to a raster format (JPEG, for example):
Mikhail
CADRasterImage object is intended for loading raster images and doesn't vectorize (convert to vector objects) the raster graphics. So, the DXF export doesn't make sense for the CADRasterImage. However, it is possible to save the CADRasterImage object to a raster format (JPEG, for example):
Code: Select all
using CADImport;
using CADImport.RasterImage;
using System.Drawing.Imaging;
...
private void miSaveAsJPEG_Click(object sender, EventArgs e)
{
if (cadImage != null)
{
DRect imageSize = new DRect(0, 0, cadImage.AbsWidth, cadImage.AbsHeight);
cadImage.SaveToFile(Path.ChangeExtension(fileName, ".jpg"), ImageFormat.Jpeg, imageSize);
}
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support