0 امتیاز
سلام دوستان خوبین ببخشید میخواستم راهنمایم کنین وقتی که کاربر یک دکمه را فشار داد یک گیف شروع به پخش کردن بشه در حالت عادی نمیخوام که گیف معلوم شه وقتی که کاربر کلیدو زد شروع به پخش شه

1 پاسخ

+1 امتیاز

سلام سمپل خود ماکروسافت هستش

 

using System;
using System.Drawing;
using System.Windows.Forms;

public class animateImage : Form 
{

    //Create a Bitmpap Object.
    Bitmap animatedImage = new Bitmap("SampleAnimation.gif");
    bool currentlyAnimating = false;

    //This method begins the animation.
    public void AnimateImage() 
    {
        if (!currentlyAnimating) 
        {

            //Begin the animation only once.
            ImageAnimator.Animate(animatedImage, new EventHandler(this.OnFrameChanged));
            currentlyAnimating = true;
        }
    }

    private void OnFrameChanged(object o, EventArgs e) 
    {

        //Force a call to the Paint event handler.
        this.Invalidate();
    }

    protected override void OnPaint(PaintEventArgs e) 
    {

        //Begin the animation.
        AnimateImage();

        //Get the next frame ready for rendering.
        ImageAnimator.UpdateFrames();

        //Draw the next frame in the animation.
        e.Graphics.DrawImage(this.animatedImage, new Point(0, 0));
    }

    public static void Main() 
    {
        Application.Run(new animateImage());
    }
}

 

بفرما کدش یه خط هم نیست با زدن باتن از پخش میشه

http://www.w3-farsi.com/forum/?qa=blob&qa_blobid=3049929939950379361

 

توسط (7,164 امتیاز) 4 7 141
سوال جدید

2,337 سوال

2,871 پاسخ

3,725 دیدگاه

3,924 کاربر

دسته بندی ها

...