AddImageShapeByCode
<< Click to Display Table of Contents >> Navigation: TMyCAD > Methods > AddImageShapeByCode |
function AddImageShapeByCode(TheName:String;LeftTop:TPoint;ABitmap:TBitmap):integer;
Description:
Add image shape by code, if you want add other shape , Please use procedure AddShapeByCode or AddCmbShapeByCode
Return Value:
-1: Add failed
else(>=0): The new shape's shapeId.
Parameter
TheName:Image shape's name
LeftTop:the point of the image's Lfte-Top corner.
ABitmap:a image that you want add into TCAD
Example:
var
myBitmap:TBitmap;
begin
{Create a temp bitmap to load form a disk file}
MyBitmap := TBitmap.Create;
{Load from files}
Mybitmap.LoadFromFile( ExtractFilePath(Application.ExeName) +'images\1'+'.bmp');
{a layer0 already exist by default}
{Add Image into TMyCAD by code}
MyCAD1.AddImageShapeByCode('MyImage',MyPoint(50,100),MyBitmap);
{free it because no use}
MyBitmap.Free;
end;
See also: