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

Username:   Password: 
 RegisterRegister   
 [Tutorial] Using .GIF Images In Turing! YES its posible!!!!
Index -> Programming, Turing -> Turing Tutorials
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
the_short1




PostPosted: Sat Apr 24, 2004 2:29 am   Post subject: [Tutorial] Using .GIF Images In Turing! YES its posible!!!!

Ok... ever wonder how u could put a picture like this into Turing??
Posted Image, might have been reduced in size. Click Image to view fullscreen.

Here it is folks... I have known about this for a while know and i though i would share with u my knowledge.... YES!!!! u can use GIF images in TURING!!! You cant just go:
Pic.Draw (pic,0,0,"pic.gif") but noone said compsci was that easy
ok.... here is the simplified version of my code...
Code:
code:

var picnum, pic : int := 0
loop
if picnum not= 8 then
picnum += 1
else     
picnum := 1   
end if   
pic := Pic.FileNew ("can" + intstr (picnum) + ".BMP")   
Pic.Draw (pic, maxx div 2 - 75, maxy div 2 - 50, picCopy)
end loop

Looks simple eh?... note above wont work without the pictures...
just wanted to show its not much coding... the downloadable one below explains it all in the use of commenting..... Plus below is also some instructions that u need to know..

First off... its almost mandatory to have 'Irfanview' to do this...
www.irfanview.com
irfamview is only 800 Kb and its free... no spyware.. No crap.. Its awesome

First Step:
open the .gif in irfanview
go to 'options'
click on extract all frames
save to a location on ur hard drive
*** u can rename the files using irfanviews BATCH rename/conversion in the 'file' menu... or u can do it by hand to make the file name short with numbers at the end... *** note for my tutorial start at the number one..

Ok.... now u should have a bunch of pictures.... lets say...
can1.bmp
can2.bmp...
etc"¦ no zeros before the numbers! Or you'll have to change this line to:
("can0" + intstr (picnum) + ".BMP") or worse if u have more then one zero appear.. easier if u don't..
Now the magic... ***download the file bellow...

hope this inspires young minds to make cooler programs with animated pictures... and hopefully some brownie points or some compsci bits
if u want an example of how benificial this can be.... go download my Jail break remake in source code... it has an animated zergling....!!!

Hope That Helps, Edited For Spelling And Spaces On Jan15th By Short1 <sorry it was REALLY bad before.



gifs.zip
 Description:
has more detailed info in the .t file

Download
 Filename:  gifs.zip
 Filesize:  71.85 KB
 Downloaded:  1426 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Sat Apr 24, 2004 6:21 am   Post subject: (No subject)

Nice tutorial, I might use it for some kind of intro to a program. But you should have correct spelling on the topic title lol.
Dan




PostPosted: Sat Apr 24, 2004 3:31 pm   Post subject: (No subject)

well that is not realy using gif images but it is a good demostartion on how to animate things in turing. this conspece can also be modfied to show videos in turing by spliting all the frames in to jpg or other img files.

there are many apps out there to slpit up video and gif files, but persoanly i like VirtualDub and some of abobes imging tools.

i think it whould be cool if some one looked up the foramt for gif images and aucaly worte an add on for turing to realy load gif files even if they where not animated. but that whould probly be alot of work when free langs like java can all ready do it...
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
recneps




PostPosted: Sat Apr 24, 2004 4:35 pm   Post subject: (No subject)

i was searching for corel or something on google, and this page popped up with the whole shematics for wordperfect graphics(.wpg)
so im sure theres one on gif... it wouldnt be that hard.
*dont look at me to do it* lol Wink
the_short1




PostPosted: Sun Apr 25, 2004 5:51 pm   Post subject: (No subject)

COOL!.... i fixed spelling..
.
yea... lots of works to make .gif files load.... and they prob not animated.. cuz it would need to be a process...

yea.... to show videos..... u can use Sys.Exec .. itll pop up wmp but hey...

*** look in turing examples... they open a video...
Raugrist




PostPosted: Sun Apr 25, 2004 6:12 pm   Post subject: (No subject)

That video playing "tutorial" had to have been among the stupidest things holtsoft could've thought to include. That's almost like saying:

Here's how to make a first person shooter in one line of code
code:

if Sys.Exec ("c:/unreal tournament/system/ut.exe") then end if


Well, perhaps a bit of exaggeration, but....

Anyways, for GIFs (and all images really) in a real language, you would open the file, then read in a sequence of bytes that are used to draw pixels with those specific colours.
Paul




PostPosted: Sun Apr 25, 2004 6:19 pm   Post subject: (No subject)

the_short1 wrote:
COOL!.... i fixed spelling..

Well, you're special enough to be allowed to spell images in your own way Razz
Tony




PostPosted: Sun Apr 25, 2004 6:32 pm   Post subject: (No subject)

Raugrist wrote:
you would open the file, then read in a sequence of bytes that are used to draw pixels with those specific colours.


'cept that you'd have to know .gif encoding. And it would be a part of turing, but apparently the encoding is copyrighted and holtsoft is being cheap Rolling Eyes
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Sponsor
Sponsor
Sponsor
sponsor
Catalyst




PostPosted: Sun Apr 25, 2004 6:47 pm   Post subject: (No subject)

have fun

http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/GIF89a.txt
Raugrist




PostPosted: Sun Apr 25, 2004 6:58 pm   Post subject: (No subject)

tony wrote:
Raugrist wrote:
you would open the file, then read in a sequence of bytes that are used to draw pixels with those specific colours.


'cept that you'd have to know .gif encoding.

Sorry, I guess I just thought that was implied.

tony wrote:
And it would be a part of turing, but apparently the encoding is copyrighted and holtsoft is being cheap Rolling Eyes

Yeah, I know the encoding is copyrighted and you aren't supposed to use it without paying [insert name of morons who created GIF format], but you need not look any further than your own copy of turing to see how a copyright isn't going to stop many people. It'd be really cool if you could load a picture much the same way you load one in OpenGL and stuff instead of just Pic.FileNew(...) so you could add support for better formats like PNG or even GIF.
Catalyst




PostPosted: Sun Apr 25, 2004 6:59 pm   Post subject: (No subject)

u can load anything anyway you like in turing its just a matter of actually doing it
the_short1




PostPosted: Mon Apr 26, 2004 9:07 am   Post subject: (No subject)

yea..... sounds to hard an confusing.,.... maybe u can do it catalyst.... ***since ur a pro... and im not.. :S

anyways.... this is the most viable and easy way to add .gif pictures... or movies into Turing....... . . . . . i hope to make a REALLY cool Bound Map where everything **including deaths are GIF images...
so u can run around and kill lets say... marine... it will work Smile
jordan




PostPosted: Sun Jan 16, 2005 12:47 am   Post subject: (No subject)

the_short1 wrote:
yea..... sounds to hard an confusing.,.... maybe u can do it catalyst.... ***since ur a pro... and im not.. :S

anyways.... this is the most viable and easy way to add .gif pictures... or movies into Turing....... . . . . . i hope to make a REALLY cool Bound Map where everything **including deaths are GIF images...
so u can run around and kill lets say... marine... it will work Smile


cool,, but the picture has to be in the same folder as in the file of turing, correct?
Leftover




PostPosted: Sun Jan 16, 2005 1:32 am   Post subject: (No subject)

Paul wrote:
Nice tutorial, I might use it for some kind of intro to a program. But you should have correct spelling on the topic title lol.


As well as all the text in the post, considering someone want's their tutorial posted Razz
Leftover




PostPosted: Sun Jan 16, 2005 1:35 am   Post subject: (No subject)

jordan wrote:
cool,, but the picture has to be in the same folder as in the file of turing, correct?


You can put it in the directory where the .t file is stored, or you can put the full file path in, with the \ reversed so it is like the web with /. I.E. "C:/Program Files/Companyname/Gamename/data/image.jpg" would include a picture in the root folder of your game, in this case, C:\Program Files\Companyname\Game name, then in the data directory of that file, with an image named image.jpg.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 24 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: