Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
atwis
Posted - Feb 12 2013 : 21:21:42 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
2 L A T E S T R E P L I E S (Newest First)
atwis
Posted - Feb 14 2013 : 21:13:48 Many Thanks
xequte
Posted - Feb 13 2013 : 01:19:22 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.