ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnVect dynamic create
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

lostman

5 Posts

Posted - May 10 2013 :  05:49:38  Show Profile  Reply
var
vect: TImageEnVect;

begin
vect:= TMyImageEnVect.Create(Self);
vect.Parent:=Self;
vect.Align:= alClient;
vect.AddNewObject(iekBOX, Rect(10,10,100,100), clRed);
end;

When using this code, not create any object. Canvas is white.



w2m

USA
1990 Posts

Posted - May 10 2013 :  06:41:44  Show Profile  Reply
When ImageEnVect is created at runtime it looks like it is important to create a bitmap before adding an object:
procedure TForm1.FormCreate(Sender: TObject);
var
  hobj: integer;
begin
  ImageEnVect := TImageEnVect.Create(self);
  ImageEnVect.Parent := self;
  ImageEnVect.Left := 0;
  ImageEnVect.Top := 0;
  ImageEnVect.Align := alClient;
  ImageEnVect.Background := clBtnFace;
  ImageEnVect.BorderStyle := bsSingle;
  ImageEnVect.BackgroundStyle := iebsSolid;
  ImageEnVect.IEBitmap.Allocate(640, 480); // Important  
  ImageEnVect.IEBitmap.Fill(clBtnFace);
  ImageEnVect.Update;
  ImageEnVect.AddNewObject(iekBOX, Rect(10, 10, 100, 100), clRed);
end;

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: