How to add a CADImageEnt?
Moderators: SDS, support, admin
How to add a CADImageEnt?
How to Add a CADImageEnt? Not use EntitiesCreator.
There is no code in AddEntityDemo.
who know?
Thanks!
There is no code in AddEntityDemo.
who know?
Thanks!
Re: How to add a CADImageEnt?
Hello.
You can use the following code snippet:
Alexander.
You can use the following code snippet:
Code: Select all
public class MainForm : System.Windows.Forms.Form
{
...
private CADImport.CADImage cadImage;
private CADPictureBox cadPictBox;
...
private void miAbout_Click(object sender, System.EventArgs e)
{
if (this.cadImage == null)
{
this.cadImage = new CADImage();
this.cadImage.InitialNewImage();
}
CADImageEnt entRaster = new CADImageEnt();
string tmp = "c:\\Users\\Support.CST\\Pictures\\viewer.bmp ";
Bitmap bmpTmp;
if (!System.IO.File.Exists(tmp)) return;
try
{
bmpTmp = new Bitmap(tmp);
}
catch
{
return;
}
CADImageDef def = new CADImageDef();
def.FileName = tmp;
def.Loaded(this.cadImage.Converter);
entRaster.ImageDef = def;
entRaster.Color = CADConst.clNone;
entRaster.Point = new DPoint(0, 0, 0);
entRaster.Size = new DPoint(bmpTmp.Width, bmpTmp.Height, 0);
entRaster.Rotate = 0;
entRaster.Loaded(this.cadImage.Converter);
this.cadImage.Converter.ImageDefs.Add(entRaster.ImageDef);
this.cadImage.Converter.OnCreate(entRaster);
this.cadImage.CurrentLayout.AddEntity(entRaster);
this.cadImage.GetExtents();
this.cadPictBox.Invalidate();
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to add a CADImageEnt?
thanks,now I can create CADImageEnt!
but, there is a new problem:
when I add a new cadImageEnt using "c:\viewer.bmp ", and save the file as **.dxf;
then I delete the picture file(c:\viewer.bmp) and reopen the **.dxf ,
the new added cadImageEnt exit,but have no image!
why?

but, there is a new problem:
when I add a new cadImageEnt using "c:\viewer.bmp ", and save the file as **.dxf;
then I delete the picture file(c:\viewer.bmp) and reopen the **.dxf ,
the new added cadImageEnt exit,but have no image!

why?
Re: How to add a CADImageEnt?
Hello.
DWG/DXF specification determines a raster image as a form of external reference. The raster drawing not added to AutoCAD file but loaded from stored raster file that must be present on hard disk.
Alexander.
DWG/DXF specification determines a raster image as a form of external reference. The raster drawing not added to AutoCAD file but loaded from stored raster file that must be present on hard disk.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: How to add a CADImageEnt?
Understand,thanks!
now,
I need draw a selected cadImageEnt in the center of the CADPictureBox in given scale.(like google earth)
how to do it?(how to calculate "LeftImagePosition" and "TopImagePosition")
now,
I need draw a selected cadImageEnt in the center of the CADPictureBox in given scale.(like google earth)
how to do it?(how to calculate "LeftImagePosition" and "TopImagePosition")
Re: How to add a CADImageEnt?
Hello.
The following topic contains code snippet for scaling specified entity to CADPictureBox client area:
http://www.cadsofttools.com/forum/viewt ... =15&t=1382
Just set the required scale: Me.ImageScale = kf1 / X //the X value will define the scale factor for visualization.
Alexander.
The following topic contains code snippet for scaling specified entity to CADPictureBox client area:
http://www.cadsofttools.com/forum/viewt ... =15&t=1382
Just set the required scale: Me.ImageScale = kf1 / X //the X value will define the scale factor for visualization.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support