1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
| procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin with image1.canvas do begin if (chr(Key) = chr(vk_left)) then begin image1.canvas.lineto(penpos.x-1,penpos.y) end ; if (chr(Key) = chr(vk_right)) then begin image1.canvas.lineto(penpos.x+1,penpos.y) end ; if (chr(Key) = chr(vk_up)) then begin image1.canvas.lineto(penpos.x,penpos.y-1) end ; if (chr(Key) = chr(vk_down)) then begin image1.canvas.lineto(penpos.x,penpos.y+1) end; if (chr(Key) = chr(vk_left))and (chr(Key) = chr(vk_up)) then begin image1.canvas.lineto(penpos.x-1,penpos.y-1) end ; if (chr(Key) = chr(vk_left))and (chr(Key) = chr(vk_down)) then begin image1.canvas.lineto(penpos.x-1,penpos.y+1) end ; if (chr(Key) = chr(vk_right))and (chr(Key) = chr(vk_up)) then begin image1.canvas.lineto(penpos.x+1,penpos.y-1) end ; if (chr(Key) = chr(vk_right))and (chr(Key) = chr(vk_down)) then begin image1.canvas.lineto(penpos.x+1,penpos.y+1) end;
end; end; |