Tutorials to .com

Tutorials to .com » Database » Foxpro » Animation of simulation in the VFP

Animation of simulation in the VFP

Print View , by: iSee ,Total views: 31 ,Word Count: 430 ,Date: Sat, 18 Apr 2009 Time: 2:37 PM

In today's large number of programming languages, VFP's simple, convenient and practical so that I have been. It not only provides small and medium-sized databases to improve the management and operation mechanism, the application interface design also provides a wealth of means. For example, vfp Form Designer provides the image control, allowing us to add directly in the form. BMP picture. Slightly less than that it does not support other image formats, not to mention is the animation.

As the image control and other controls, as has its own set of attributes, in the design can change it dynamically, so Iin practice a viable alternative in the VFP form to add a simulated "animation" . The design idea is to prepare a few coherent frame. BMP images (related to the mapping software can be used on its own production), use the timer function of time, in the time intervals change dynamically displayed. BMP images. I through a presentation on examples to illustrate this: First of all, I have prepared a consistent 4 flag floating image, respectively, named: 1.bmp, 2.bmp, 3.bmp and 4.bmp. As follows (abbreviated), and then use the design form design form as follows:

Demo form

Including three control: Image (image), Timer (timer) and Command (command button). Attribute set as follows:

Image.Picture=“1.bmp”Ttimer.Enabled=.t.Timer.Interval=200Command.Caption=“”

Activate event in the form add the following code:

Public II=1 in the timer's Timer event to add code as follows: If I $#@62;=4  I=1Else   I=I+1EndifPic=Str(I,1)+".bmp"Thisform.Image.Picture= Pic

Click the button in order to add the code the incident as follows:

Thisform.Release

Finally, save and run the form, we will see a window in a bright red flag fluttered in the breeze. Click "Exit demo" command button, analog animation the end of the presentation.


FoxPro Tutorial Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.