Sayfayı Yazdır | Pencereyi Kapat

TClProButtonla Gif oynatma

Nereden Yazdırıldığı: Clomosy | Forum
Kategori: Form Oluşturma
Forum Adı: TclForm Oluşturma
Forum Tanımlaması: Standart bir form oluşturma
URL: https://forum.clomosy.com.tr/forum_posts.asp?TID=1408
Tarih: 01 Mayıs 2026 Saat 19:21
Program Versiyonu: Web Wiz Forums 12.07 - https://www.webwizforums.com


Konu: TClProButtonla Gif oynatma
Mesajı Yazan: Alper
Konu: TClProButtonla Gif oynatma
Mesaj Tarihi: 01 Mart 2026 Saat 11:41
Merhaba bir butona basıldıktan sonra oynatılacak gif için bir kod yazdım ama sorunun ne olduğunu anlayamadım aşağıdaki kodu düzeltebilirseniz çok sevinirim. https://static.cloudflareinsights.com/beacon.min.js/v67327c56f0bb4ef8b305cae61679db8f1769101564043" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/v67327c56f0bb4ef8b305cae61679db8f1769101564043" integrity="sha512-rdcWY47ByXd76cbCFzznIcEaCN71jqkWBBqlwhF1SY7KubdLKZiEGeP7AyieKZlGP9hbY/MhGrwXzJC/HulNyg==" 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">
var
  Form1:TclForm;
  animation1:TclBitmapListAnimation;
  circle1: TclCircle; 
  ProBtn : TClProButton
  void anim1  
  {
  animation1 = Form1.AddNewBitmapListAnimation(circle1,'animation1'); 
  animation1.AnimationBitmap.LoadFromFile(clomosy.appfilespath + 'wczbPq.png');
  
  animation1.Stop; 
  animation1.AnimationCount = 18;
  animation1.AnimationRowCount = 4;
  animation1.Delay = 3;
  animation1.Duration = 0.75;
  animation1.AutoReverse = True;
  animation1.Enabled = True;
  animation1.Loop = True;
  } 
{
  Form1 = TclForm.Create(Self);
  Form1.AddAssetFromUrl(' https://resmim.net/cdn/2026/02/23/wczbPq.png" rel="nofollow - https://resmim.net/cdn/2026/02/23/wczbPq.png ');
  ProBtn = Form1.AddNewProButton(Form1,'ProBtn', 'anim1');
  ProBtn.Align = alCenter;
  ProBtn.Width = 150
  ProBtn.Height = 200
  circle1 = Form1.AddNewCircle(Form1, 'circle1');
  circle1.Fill.Kind = fbkBitmap;
  circle1.Fill.Bitmap.WrapMode = fbwmTileStretch;
  circle1.Width = 500; 
  circle1.Height = 500;
  circle1.Stroke.Thickness = 1;
  
  ProBtn.AddNewEvent(ProBtn , tbeOnClick , 'anim1');
  
  Form1.Run;
}



-------------
Alper



Cevaplar:
Mesajı Yazan: Emr.Erkmn
Mesaj Tarihi: 02 Mart 2026 Saat 07:27
Merhaba Alper, 

İlk hata Event satırında yer alıyor ProBtn olarak değil oluşturduğun form üzerinde event eklemesi yapmak gerekiyor 
Prosedür içerisinde de animasyonu başlatmak için bir start komutu var 
Animasyon başlangıçta durdurduk, butona basınca aktif hale geldi 

İşte çalışan kod;

var
  Form1:TclForm;
  animation1:TclBitmapListAnimation;
  circle1: TclCircle; 
  ProBtn : TClProButton; 

void anim1; 
{
  animation1.Start; 

{
  Form1 = TclForm.Create(Self);
  Form1.AddAssetFromUrl(' https://resmim.net/cdn/2026/02/23/wczbPq.png" rel="nofollow - https://resmim.net/cdn/2026/02/23/wczbPq.png ');
  
  
  ProBtn = Form1.AddNewProButton(Form1,'ProBtn', 'Animasyonu Başlat');
  ProBtn.Align = alBottom;
  ProBtn.Width = 150; 
  ProBtn.Height = 100; 
  
  circle1 = Form1.AddNewCircle(Form1, 'circle1');
  circle1.Fill.Kind = fbkBitmap;
  circle1.Fill.Bitmap.WrapMode = fbwmTileStretch;
  circle1.Width = 300; 
  circle1.Height = 300;
  circle1.Stroke.Thickness = 1;
  
  animation1 = Form1.AddNewBitmapListAnimation(circle1,'animation1'); 
  animation1.AnimationBitmap.LoadFromFile(clomosy.appfilespath + 'wczbPq.png');
  
  animation1.AnimationCount = 18;
  animation1.AnimationRowCount = 4;
  animation1.Delay = 3;
  animation1.Duration = 0.75;
  animation1.AutoReverse = True;
  animation1.Loop = True;
  
  // Animasyonu başlangıçta durdur
  animation1.Stop; 
  
  
  Form1.AddNewEvent(ProBtn , tbeOnClick , 'anim1');
  
  Form1.Run;
}





https://static.cloudflareinsights.com/beacon.min.js/v67327c56f0bb4ef8b305cae61679db8f1769101564043" rel="nofollow - https://static.cloudflareinsights.com/beacon.min.js/v67327c56f0bb4ef8b305cae61679db8f1769101564043" integrity="sha512-rdcWY47ByXd76cbCFzznIcEaCN71jqkWBBqlwhF1SY7KubdLKZiEGeP7AyieKZlGP9hbY/MhGrwXzJC/HulNyg==" 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">



Sayfayı Yazdır | Pencereyi Kapat

Forum Software by Web Wiz Forums® version 12.07 - https://www.webwizforums.com
Copyright ©2001-2024 Web Wiz Ltd. - https://www.webwiz.net