insert bitmap in cadimage
Moderators: SDS, support, admin
insert bitmap in cadimage
Hi,
I need to convert a bitmap into a cadentity, to insert it in my cadimage. is there a method to do this conversion? if it doesn't exist, can I insert the bitmap directly in my cadimage?
thank you,
lulu.
I need to convert a bitmap into a cadentity, to insert it in my cadimage. is there a method to do this conversion? if it doesn't exist, can I insert the bitmap directly in my cadimage?
thank you,
lulu.
Re: insert bitmap in cadimage
Hello lulu.
Bitmap or other raster can be added into CADImage object as an ImageEnt object:there is also DoResize method within demo applications to correct sizes ratio if necessary.
Alexander.
Bitmap or other raster can be added into CADImage object as an ImageEnt object:
Code: Select all
if (this.cadImage == null)
{
this.cadImage = new CADImage();
this.cadImage.InitialNewImage();
}
this.cadImage.UseDoubleBuffering = false;
CADImageEnt entRaster = new CADImageEnt();
string tmp = your_file;
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.cadPictBox.Invalidate();
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support