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

Username:   Password: 
 RegisterRegister   
 Animated GIFs in Turing
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
O(128)




PostPosted: Sun May 02, 2010 7:23 pm   Post subject: Animated GIFs in Turing

What is it you are trying to achieve?
I am attempting to display an Animated GIF file in Turing.

What is the problem you are having?

When I load the GIF, the background of the GIF is changed from being transparent to pink

Describe what you have tried to solve this problem

I loaded the GIF to an online editor (http://www.online-image-editor.com/), and attempted to reset the transparency, but when Turing loaded the modified file the files was distorted with random bars of color. I also tried messing around with View.Set and View.Update, but it didn't work. When I converted the gif to a jpeg, the transparent background was set to the same shade of pink that was displayed in Turing.

According to the Turing 4.1 update:

Quote:
GIF files can specify a "transparent color", and this is supported by Turing. When a GIF with a transparent color is loaded by Turing, the "transparent color" is added to the color palette (if not already present). If the picture is displayed using the picMerge mode, the "transparent color" will not be displayed. Note that the "transparent color" is a real color. If you use the picCopy mode, this color is displayed.


I suspect that when Turing tried to load the GIF, it didn't load the transparent color into its palette and set it to a default color. I would appreciate it if someone could tell me how to load the transparent color, or tell me what number represents the default color in Turing so I can attempt to use View.SetTransparentColor to work around it

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:

var numFrames := Pic.Frames ("run.gif")
var pics : array 1 .. numFrames of int
var delayTime : int := 1
Pic.FileNewFrames ("run.gif", pics, delayTime)
View.Set ("graphics,offscreenonly")


loop
Pic.DrawFrames (pics, 10, 10, picMerge, numFrames, 100, false)
View.Update
end loop



Please specify what version of Turing you are using
<4.1>

Thank you for your time
Sponsor
Sponsor
Sponsor
sponsor
USEC_OFFICER




PostPosted: Sun May 02, 2010 10:19 pm   Post subject: RE:Animated GIFs in Turing

Try Pic.Transparentcolour or something like that. It's been a while.
O(128)




PostPosted: Mon May 03, 2010 10:03 am   Post subject: RE:Animated GIFs in Turing

The thing is I don't know how to determine the value of the new background of the GIF file, so I can't use Pic.Transparentcolour
USEC_OFFICER




PostPosted: Mon May 03, 2010 11:34 am   Post subject: RE:Animated GIFs in Turing

Try editing them to a colour you do know then.
O(128)




PostPosted: Mon May 03, 2010 3:53 pm   Post subject: RE:Animated GIFs in Turing

I apoligise for not being more clear, but I don't how to determine the value of any colour. Is there some function in Turing that would allow me to specifiy a pixel and have it output the value representing the color or something like that?
O(128)




PostPosted: Mon May 03, 2010 9:28 pm   Post subject: RE:Animated GIFs in Turing

And the mystery deepens, I tried using whatdotcolor to figure out the value that the pink represented, but according to it, the value was 0
USEC_OFFICER




PostPosted: Tue May 04, 2010 12:00 pm   Post subject: RE:Animated GIFs in Turing

Then did you try and see what 0 did?
hamid14




PostPosted: Wed May 05, 2010 11:10 am   Post subject: Re: Animated GIFs in Turing

This is a probably the long way of doing it, but maybe he could split the the individual frames of the GIF using IrfanView, and then use GIMP or another good image editing program to make the background transparent. Probably should avoid this if he has more than a 1000 frames, lol.
Sponsor
Sponsor
Sponsor
sponsor
USEC_OFFICER




PostPosted: Wed May 05, 2010 12:14 pm   Post subject: RE:Animated GIFs in Turing

Or edit it frame to colours reconized by Turing.
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  [ 9 Posts ]
Jump to:   


Style:  
Search: