How to add a CADImageEnt?
Posted: 12 Mar 2011, 10:57
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!
CADSoftTools - AutoCAD DWG DXF HPGL (PLT) SVG CGM STEP IGES STL SAT viewers, converters and developer tools. Delphi and C# source code.
https://cadsofttools.com/forum/
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();
}