Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!

Status
Not open for further replies.

garyvugelman

Programmer
Jul 18, 2003
11
US
Is there any way you can make a picture object spin. Using pb7. Thanks.
 
You could use the Timer event in the window holding the picture control to rapidly swap the bmp file using the SetPicture method of the picture control.

See the PB help file for details.

BTW: a more descriptive subject for you post would probably get more responses.
 
Garyvugelman,

The old-fashioned way to spin picture controls in older versions of PowerBuilder is to use multiple Bitmap files. Suppose you have 10 bitmaps of file Globe.bmp from Globe1.bmp to Globe10.bmp:

Window's instance var: integer ii_Bitmap


Window.Open! event:
------------------
Timer( 0.3 )


Window.Timer! event:
-------------------
ii_Bitmap++
//
IF ii_Bitmap > 10 THEN
ii_Bitmap = 1
END IF
//
p_Globe.FileName = "c:\work\globe" + String( ii_Bitmap ) + ".bmp"

The above trick swaps bitmap files displaying them in the sequence of the rotation of the globe. However, the modern way of animating picture controls is to use GIF files that are supported in the later versions of PowerBuilder.

---
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top