יום ראשון, 6 בספטמבר 2009

VALA : אז איך מוסיפים אנימציות מקבציי gif לתוכנה שלכם?

הוסיפו קובץ לפרוייקט שלכם ובתוכו הדביקו את הקוד הבא:
using Gtk;

public class Animation : EventBox {
public Animation (Fixed parent) {
var anim = new Gdk.PixbufAnimation.from_file ("animation.gif");
var image = new Gtk.Image.from_animation (anim);
add(image);
parent.add(this);
parent.move(this,200,200);
}
}
בתוכנה שלכם הגדירו אובייקט מסוג Animation כאשר בסוגריים ה Container עליו אתם רוצים לשים את האנימצייה,
לדוגמא:
private Animation ani = new Animation(fixed);

אין תגובות:

הוסף רשומת תגובה