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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Vectors as template

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
pierrotsc Posted - Oct 29 2012 : 12:49:02
I am trying to create a behavior and I cannot figure out on how to make it work.
I want to load an image, draw some boxes as template on top of the image.
Then i want to be able to move or rotate the image without moving the vectorial template.
Right now, if i move the image, the red boxes move with it.
Any idea if that can be done?
Thanks.
P
2   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Nov 06 2012 : 01:00:12
You may create a transparent layer 0, as static base for vectorial objects, then load the image in layer 1. Example:

  // cleanup
  ImageEnVect1.LayersClear();

  // add new layer loading from file (layer 1)
  ImageEnVect1.LayersAdd('hongkong.jpg');

  // adjust layer 0 size to match loaded image and make it transparent
  ImageEnVect1.Layers[0].Bitmap.Allocate(ImageEnVect1.Layers[1].Width, ImageEnVect1.Layers[1].Height);
  ImageEnVect1.Layers[0].Bitmap.AlphaChannel.Fill(0);

  // draw some vectorial boxes
  for i := 1 to 4 do
    with ImageEnVect1, ImageEnVect1.IEBitmap do
    begin
      ObjLayer[-1] := 1;
      AddNewObject(iekBOX, Rect(random(Width), random(Height), random(Width), random(Height)), clRed);
    end;



Now you can rotate layer 1:

  ImageEnVect1.CurrentLayer.Rotate := ImageEnVect1.CurrentLayer.Rotate + 45;
  ImageEnVect1.Update(); 
pierrotsc Posted - Oct 29 2012 : 15:56:09
Let me add something more. I modified the vectorial demo. I am loading a background image and drawing a box on top. I have the layer 0 unlocked. If i rotate the image, everything is good but if i move the image, the box moves with it. I do not want that. How can i prevent the vector layer not to move?
Thanks.
P