Merhaba Kaan, GESTURE kullanarak yaptığım örneği aşağıya ekliyorum. İncelersin;
var myForm: TclForm; gestureImg: TClImage; statusLbl: TclLabel; currentScale: Single; ProPanel1 : TclProPanel;
void OnGestureDetected; { // SINIR KONTROLLERİ // Sol Sınır if gestureImg.Position.X < 0 gestureImg.Position.X = 0; // Sağ Sınır if gestureImg.Position.X > (ProPanel1.Width - gestureImg.Width) gestureImg.Position.X = ProPanel1.Width - gestureImg.Width; // Üst Sınır if gestureImg.Position.Y < 0 gestureImg.Position.Y = 0; // Alt Sınır if gestureImg.Position.Y > (ProPanel1.Height - gestureImg.Height) gestureImg.Position.Y = ProPanel1.Height - gestureImg.Height;
currentScale = gestureImg.Scale.X; if currentScale < 3.0 { gestureImg.Scale.X = currentScale + 0.1; gestureImg.Scale.Y = currentScale + 0.1; statusLbl.Text = 'Zoom Seviyesi: ' + FloatToStr(gestureImg.Scale.X); } else { statusLbl.Text = 'Maksimum sınıra ulaşıldı! (3x)'; } }
void OnImgClick; { statusLbl.Text = 'Resim Sıfırlandı.'; gestureImg.Scale.X = 1.0; gestureImg.Scale.Y = 1.0; // Resmi tekrar panelin ortasında gestureImg.Position.X = (ProPanel1.Width - gestureImg.Width) / 2; gestureImg.Position.Y = (ProPanel1.Height - gestureImg.Height) / 2; }
{ myForm = TclForm.Create(Self); statusLbl = myForm.AddNewLabel(MyForm, 'statusLbl', 'Resim üzerinde hareket deneyin'); statusLbl.Align = alMostTop; statusLbl.Height = 50; statusLbl.StyledSettings = ssFamily; statusLbl.TextSettings.Font.Size = 18; statusLbl.TextSettings.WordWrap = True; // Panel Oluşturma ProPanel1 = myForm.AddNewProPanel(myForm, 'ProPanel1'); ProPanel1.Align = alClient; ProPanel1.Margins.Top = 10; ProPanel1.Margins.Left = 10; ProPanel1.Margins.Right = 10; ProPanel1.Margins.Bottom = 10; ProPanel1.clProSettings.BackgroundColor = clAlphaColor.clHexToColor('#016f0e'); ProPanel1.clProSettings.RoundHeight = 10; ProPanel1.clProSettings.RoundWidth = 10; ProPanel1.clProSettings.BorderWidth = 2; ProPanel1.clProSettings.IsFill = True; ProPanel1.clProSettings.IsRound = True; ProPanel1.SetclProSettings(ProPanel1.clProSettings); gestureImg = myForm.AddNewImage(ProPanel1, 'gestureImg'); MyForm.setImage(gestureImg, ' https://clomosy.com/demos/bg.png" rel="nofollow - https://clomosy.com/demos/bg.png '); gestureImg.Align = alNone; gestureImg.Height = 150; gestureImg.Width = 150; // Resmi Başlangıçta Panelin Ortasında gestureImg.Position.X = (ProPanel1.Width - gestureImg.Width) / 2; gestureImg.Position.Y = (ProPanel1.Height - gestureImg.Height) / 2; MyForm.clSetTouchIG(igZoom, gestureImg); // Olayları Bağla MyForm.AddNewEvent(gestureImg, tbeOnGesture, 'OnGestureDetected'); MyForm.AddNewEvent(gestureImg, tbeOnClick, 'OnImgClick'); myForm.Run; } https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"version":"2024.11.0","token":"439455f3e46c40b98dbd42a2f1a954d8","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}" crossorigin="anonymous">
|