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

Username:   Password: 
 RegisterRegister   
 Can I resize an image in Turing?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Cezna




PostPosted: Thu Jun 10, 2010 2:45 pm   Post subject: Can I resize an image in Turing?

Is it possible to re-size an image in Turing?
I have a clock program that I want to be able to have appear in different sizes, and instead of going through the work of making everything relative in size, I figured I could just take a picture of the clock in full size, then shrink/enlarge it before using View.Update.
This might not be the best solution, and I might not end up using it, but I would like to know if it is possible for future reference.
Sponsor
Sponsor
Sponsor
sponsor
TheGuardian001




PostPosted: Thu Jun 10, 2010 3:03 pm   Post subject: Re: Can I resize an image in Turing?

pic_scale will scale an image, but it needs to be an actual image that you draw using Pic.Draw. There's no way that I know of to scale the output before drawing it with View.Update.
Tony




PostPosted: Thu Jun 10, 2010 3:09 pm   Post subject: RE:Can I resize an image in Turing?

You can capture an area of the window as a Picture; then all of the Pic module will be available just the same.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Prince Pwn




PostPosted: Thu Jun 10, 2010 4:44 pm   Post subject: RE:Can I resize an image in Turing?

Or you can do it the hard way. Use whatdotcolor to view the color of the pixel beneath the coord's, and do that to scan each color of your image. Then draw it back instead of 1 pixel at a time, draw in blocks of 4.
Cezna




PostPosted: Thu Jun 10, 2010 5:10 pm   Post subject: RE:Can I resize an image in Turing?

Think I'll avoid that last way, but I know about using Pic.New to take pictures of the screen, that is what I intended to do to get the image I would be resizing, sorry if I didn't make that clear.

Thanks for the help everyone.
TheGuardian001




PostPosted: Thu Jun 10, 2010 10:45 pm   Post subject: Re: Can I resize an image in Turing?

Ah. I was confused because you said you wanted to scale the image before using View.Update. Cause Pic.New only works with the screen buffer, not the offscreen buffer (as far as I know)
Cezna




PostPosted: Fri Jun 11, 2010 5:24 am   Post subject: RE:Can I resize an image in Turing?

It seems to work with the offscreen buffer.
This is the way I am using it now in my program, and I don't seem to be having any trouble with it.
Smile
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  [ 7 Posts ]
Jump to:   


Style:  
Search: