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
 Move object white keyboard "up/down/left,right"
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

atwis

Indonesia
7 Posts

Posted - Feb 12 2013 :  21:21:42  Show Profile  Reply
I saw a sample demo application "layers", here there is facility to add a new screen, how to move the new layer by using the keyboard "Up / Down / Left / Right".
Here are sample images, how to shift the image selected, use the keyboard. I've tried to use this function:

TFormMain.ImageEnView1SpecialKey procedure (Sender: TObject; charcode: Word; Shift: TShiftState; var Handled: Boolean);
begin
    charcode case of
     vk_Left:
       ImageEnView1.MoveSelection (-1, 0);
     vk_Down:
       ImageEnView1.MoveSelection (0, 1);
     vk_Right:
       ImageEnView1.MoveSelection (1, 0);
     vk_Up:
       ImageEnView1.MoveSelection (0, -1);
   end;
end;

but the results have not been able to? is there another solution?
Thanks in advance

xequte

38616 Posts

Posted - Feb 13 2013 :  01:19:22  Show Profile  Reply
Hi

MoveSelection is for moving a selected region of the image, not a layer, instead use something like:

vk_Up: if assigned(ImageEnView1.CurrentLayer) then
         ImageEnView1.CurrentLayer.PosY := Max(0, ImageEnView1.CurrentLayer.PosY - 10);
...
etc.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

atwis

Indonesia
7 Posts

Posted - Feb 14 2013 :  21:13:48  Show Profile  Reply
Many Thanks
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: