Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Saving?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
wrectify




PostPosted: Tue Jun 03, 2003 1:07 pm   Post subject: Saving?

I have made a paintbrush type program and i was wondering how to save the picture. Can anyone help me?
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Tue Jun 03, 2003 2:09 pm   Post subject: (No subject)

i'm not sure, but i don't think you can
Tony




PostPosted: Tue Jun 03, 2003 2:38 pm   Post subject: (No subject)

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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Asok




PostPosted: Tue Jun 03, 2003 4:31 pm   Post subject: (No subject)

it's Pic.Save

code:
% 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




PostPosted: Wed Jun 04, 2003 12:53 pm   Post subject: (No subject)

Yo thanks alot Asok you helped out quite a bit
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: