(15-03-2018, Saat: 23:04)pro_imaj Adlı Kullanıcıdan Alıntı: [ -> ]Merhaba;
Bu konuda 10.2.3 versiyonun bir gelişme yok mu yoksa yine Fesih bey'in belirttiği şekilde mi yapılıyor hala. Kurup deneyen var mı acaba.
İyi çalışmalar.
Merhaba,
Tahminimce o kısım (pan, zoom vb. interaktif etkileşimler) biz geliştiricilere bırakılmış.
TGestureManager, Pan veya Zoom ile sınırlı olmayıp bir çok kullanıcı etkileşimi içerdiğinden ve TFMXObject sınıfı tarafından ortak kullanılan bir özellik olduğundan TImage için özelleştirilmiş değildir.
İstediğiniz özellikler
Quark Cube tarafından Image bileşenine entegre edilmiş hali açık kaynak kod olarak paylaşılmaktadır.
Kaynak:
FMX Image Layout
Merhaba;
Fesih bey'in örneğine göre birkaç işlem eksik şekilde aşağıdaki şekilde uygulanabilir.
Image nesnesinin Zoom işlemleri için;
1- Forma bir adet Image nesnesi yerleştirin.
2- Image nesnesine herhangi bir resim ekleyin.
4- Object Inspector'dan Formun Touch>InteractiveGestures özelliğinin Zoom özelliğini True yapın.
5- Projenin aşağıdaki aşağıdaki tanımlamaları yapın;
var
FLastDistance: Integer;
PinchZoom: TForm1;
procedure TForm1.FormGesture(Sender: TObject;
const EventInfo: TGestureEventInfo; var Handled: Boolean);
var
LObj: IControl;
LImage: TImage;
LImageCenter: TPointF;
begin
if EventInfo.GestureID = igiZoom then
begin
LObj := Self.ObjectAtPoint(ClientToScreen(EventInfo.Location));
if LObj is TImage then
begin
if (not(TInteractiveGestureFlag.gfBegin in EventInfo.Flags)) and
(not(TInteractiveGestureFlag.gfEnd in EventInfo.Flags)) then
begin
{ zoom the image }
LImage := TImage(LObj.GetObject);
LImageCenter := LImage.Position.Point + PointF(LImage.Width / 2,
LImage.Height / 2);
LImage.Width := LImage.Width + (EventInfo.Distance - FLastDistance);
LImage.Height := LImage.Height + (EventInfo.Distance - FLastDistance);
LImage.Position.X := LImageCenter.X - LImage.Width / 2;
LImage.Position.Y := LImageCenter.Y - LImage.Height / 2;
end;
FLastDistance := EventInfo.Distance;
end;
end;
end;
İşlem tamamdır.
Kaynak : Object Pascal\Mobile Snippets\InteractiveGestures\ImageZoom