Computer Science Canada

Problem with Picture

Author:  Piro24 [ Sat Dec 23, 2006 1:54 pm ]
Post subject:  Problem with Picture

I am opening a picture and it works fine

procedure drawMachine
var machine : int := Pic.FileNew ("slotMachine.BMP")
machine := Pic.Scale (machine, maxx, maxy)
Pic.Draw (machine, 0, 0, picCopy)
end drawMachine

When I call that procedure it opens up my picture just fine. But after about 30 seconds it crashes. I don't understand why it would load then crash? It gives me the error "Picture was no created properly"

Author:  StealthArcher [ Sat Dec 23, 2006 2:10 pm ]
Post subject: 

Best I can remember, turing will try to load all declared pics, and will not show an error when one does not exist, hoiwever it will shopw sn error when you try to use the picture later on.

Author:  DIIST [ Sat Dec 23, 2006 5:07 pm ]
Post subject: 

The Problem is you need to free you resourses, ie you need to "Pic. Free(machine)" the picture once you don using it or in this case at the end of the procedure drawmachine. Other wise you will constantly create piuctures in memory and this will eveuntally casue the program to crash. I hope that was of some help. Wink


: