April 30, 2024, 11:10:06 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


object movement code

Started by TexasPete, March 01, 2010, 02:14:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TexasPete

I am translating my object movement code. Does anyone have a simple example program. This may save me sometime. I am simply trying to print a small picture and move it on the screen to a new locations. I made a search for object movement code and I have a bunch of IB stuff but I could not find an example program.

Thanks Texas Pete

ZeroDog

For GDI graphics programming, there really is only a few commands that you have.  LoadImage, ShowImage, and DeleteImage.  They each do basically what thier name implies.  For details on these functions, check the users guide.   :)

Heres a quick sample that shows how to load and display an image using the GDI graphics functions.
The bug.bmp can be found in your samples folder

def win:window
def image,imagepos:int

window win, 0,0,640,480, @caption, 0, "", winproc
image = loadimage ("bug.bmp", @imgbitmap)
starttimer win,100

run=1
waituntil run=0
deleteimage image,@imgbitmap
closewindow win
end

sub winproc
   select @class
      case @idclosewindow
         run=0
      case @idtimer
         imagepos=imagepos+5
         setwindowcolor win, rgb(255,255,255)
         showimage win, image, @imgbitmap, imagepos, 10, 84, 80
   endselect
return