Computer Science Canada

Pixel Graphics Help Needed

Author:  Rutilus [ Mon Feb 14, 2005 11:14 pm ]
Post subject:  Pixel Graphics Help Needed

I am currently in grade 11 computer science and we are working on pixel graphics. I need to save an image that takes up the left half of the screen to a file but I'm having some trouble. Here is my code:

code:

var picture : int
var file : int

picture := Pic.New (1, 1, 640, 480)

open : file, "picture", write

put : file, picture / 2


It says "Put attempt incompatible on stream number 1"

Please help, I have something due next week!

-AS

Author:  Bacchus [ Tue Feb 15, 2005 7:46 am ]
Post subject: 

you cant really divid the picID by 2 to get half of the picture. the picID is just a reference to the picture for turing. to make half the pic do
var picID:int:=Pic.New(0,0,maxx div 2,maxy)


: