
-----------------------------------
wrectify
Tue Jun 03, 2003 1:07 pm

Saving?
-----------------------------------
I have made a paintbrush type program and i was wondering how to save the picture. Can anyone help me?

-----------------------------------
Andy
Tue Jun 03, 2003 2:09 pm


-----------------------------------
i'm not sure, but i don't think you can

-----------------------------------
Tony
Tue Jun 03, 2003 2:38 pm


-----------------------------------
yeah you can. You can save picture using Pic.New(x1,y1,x2,y2)

then there's some command to save that variable as a bmp file, but I dont know the exact syntax. Pic.something

-----------------------------------
Asok
Tue Jun 03, 2003 4:31 pm


-----------------------------------
it's Pic.Save

% Program to save a picture in mypic.bmp
        var picID: int
        var x, y : int
        Draw.FillBox (50, 50, 150, 150, red)
        Draw.FillStar (50, 50, 150, 150, green)
        Draw.FillOval (100, 100, 50, 50, blue)
        picID := Pic.New (50, 50, 150, 150)
        Pic.Save (picID, "mypic.bmp")
        Pic.Free (picID)


        % Program to load the picture back again and draw 50 copies
        var picID: int
        var x, y : int
        
        picID := Pic.FileNew ("mypic.bmp")
        for i : 1 .. 50
            x := Rand.Int (0, maxx)     % Random x
            y := Rand.Int (0, maxy)     % Random y
            Pic.Draw (picID, x, y, picCopy)
        end for
        Pic.Free (picID)

-----------------------------------
wrectify
Wed Jun 04, 2003 12:53 pm


-----------------------------------
Yo thanks alot Asok you helped out quite a bit
