CADEditorControl SHOW JPG
Moderators: SDS, support, admin
CADEditorControl SHOW JPG
I USE CADEditorControl
BUT PNG CAN'T SHOW
IF I USE AUTOCAD THE FILE LINE IN D:\CTEWORK\HOUJPG\XXX.JPG
HOW DO? CAN USE CADEditorControl SHOW THIS JPG?
http://matsap.cte.com.tw:405/CADTemp/p1.png
BUT PNG CAN'T SHOW
IF I USE AUTOCAD THE FILE LINE IN D:\CTEWORK\HOUJPG\XXX.JPG
HOW DO? CAN USE CADEditorControl SHOW THIS JPG?
http://matsap.cte.com.tw:405/CADTemp/p1.png
Re: CADEditorControl SHOW JPG
Hi,windsu wrote: ↑14 Nov 2022, 05:53I USE CADEditorControl
BUT PNG CAN'T SHOW
IF I USE AUTOCAD THE FILE LINE IN D:\CTEWORK\HOUJPG\XXX.JPG
HOW DO? CAN USE CADEditorControl SHOW THIS JPG?
http://matsap.cte.com.tw:405/CADTemp/p1.png
First, I'd like to note that CADEditorControl is available in CAD .NET only, CAD DLL doesn't have such control.
As for the issue with displaying PNG or JPG files. Please, check the path to the required picture. Reference pictures are class instances of CADImageEnt class. While debugging and after you open a file in the demo project, you should have a look at cadImafe.Converter.Entities , and look through required CADImageEnt. This entity has ImageDef property with FileName property in it, which is used to specify the path to the picture.

Best wishes,
Catherine.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: CADEditorControl SHOW JPG
OK ,thanks
but My jpg/png in autocad use line find file
http://matsap.cte.com.tw:730/CADTemp/p2.png
how use cad CADImageEnt?
but My jpg/png in autocad use line find file
http://matsap.cte.com.tw:730/CADTemp/p2.png
how use cad CADImageEnt?
Re: CADEditorControl SHOW JPG
windsu wrote: ↑15 Nov 2022, 03:49OK ,thanks
but My jpg/png in autocad use line find file
http://matsap.cte.com.tw:730/CADTemp/p2.png
how use cad CADImageEnt?
Hi,
Please, have a look at the example below on how to add CADImageEnt (this code example is available in the AddEntities demo of CAD .NET):
Code: Select all
private void AddImageEnt()
{
string fileName = cnstImagePath;
if (!File.Exists(fileName))
{
fileName = cnstAddonPath + fileName;
if (!File.Exists(fileName))
return;
}
CADImageDef vImageDef = new CADImageDef();
vImageDef.FileName = fileName;
if (new Bitmap(vImageDef.FileName) != null)
{
AddEntToSection(ConvSection.ImageDefs, vImageDef);
CADImageEnt vImageEnt = new CADImageEnt();
vImageEnt.ImageDef = vImageDef;
vImageEnt.Point = new DPoint(370, -160, 0);
vImageEnt.UVector = CADConst.XOrtAxis;
vImageEnt.VVector = CADConst.YOrtAxis;
vImageEnt.Size = vImageEnt.ImageDef.Size;
vImageEnt.Width = 59;
if (!PlaceEntity(vImageEnt))
this.cadImage.Converter.ImageDefs.Remove(vImageDef);
imgEntHandle = vImageEnt.Handle;
}
}
private void AddEntToSection(ConvSection aSection, CADEntity aEntity)
{
this.cadImage.Converter.Loads(aEntity);
this.cadImage.Converter.GetSection(aSection).AddEntity(aEntity);
}
private bool PlaceEntity(CADEntity aEntity)
{
return PlaceEntity(aEntity, "");
}
private bool PlaceEntity(CADEntity aEntity, string aLayoutName)
{
CADLayout vLayout;
if (aLayoutName == "")
vLayout = this.cadImage.Layouts[0];
else
vLayout = this.cadImage.Converter.LayoutByName(aLayoutName);
if (vLayout == null) return false;
this.cadImage.Converter.Loads(aEntity);
vLayout.AddEntity(aEntity);
return true;
}
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support