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

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




PostPosted: Thu Jan 29, 2004 10:56 pm   Post subject: Bitmap to Turing

I'm just wondering, since a wacky idea came into my mind.. why not try to make a program that will take i dunnu, a jpg file, and draw it in turing, using dotdraw.. is that possible at all? if so, then it would be possible to create some kind of "illegal" module to implement GIFs.. and hence relieve some stress.. just i simply don't know how JPG, and BITMAPS are written in the code, and have no idea how you would go upon tackling such a challenge ...
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Thu Jan 29, 2004 11:48 pm   Post subject: (No subject)

i think some poleop have made stuff like that, check turing submisions i think i rember seeing one or two in there.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Tony




PostPosted: Fri Jan 30, 2004 12:36 am   Post subject: (No subject)

the easiest way would be to just draw the picture on screen then use whatdotcolor Laughing to read pixels.

you can then save that information in a format of your choice so you dont have to load anything on screen in an actual program, just read the file.

.maf (Mazer's Animated Format Laughing I think he wanted to copyright that) for turing is actually quite possible. Just put a View.UpdateArea in a process Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
santabruzer




PostPosted: Fri Jan 30, 2004 7:18 am   Post subject: (No subject)

well in all honesty i did tried to look and search under it, but i can't seem to find it in turing submissions.. if anyone else can find it easily tell me, and i'll look again.. plus if you find it, can you give me the keywords.. because so far, "Mazer's Animated Format" has come up empty..
shorthair




PostPosted: Fri Jan 30, 2004 9:10 am   Post subject: (No subject)

Look for MAF , im sure ive seen him post about it with that ackronym
Tony




PostPosted: Fri Jan 30, 2004 9:22 am   Post subject: (No subject)

heh, I think Mazer was just joking about .maf in that discussion of .gif copyright Confused

I think the easiest way would be to keep frames in .jpg and have something like
code:

procedure animate()
loop
     for i:1..10
     Pic.Draw(picID(i),x,y,picCopy)
     View.UpdateArea
     end for
end loop
end animate
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Cervantes




PostPosted: Fri Jan 30, 2004 9:36 am   Post subject: (No subject)

I did one of those before Turing4.0.5 without any View.UpdateArea...

the problem about these is its very unpracticle... say you had a 200x200 picture, thats not that big... you would have 40,000 lines of code!! for that ONE picture!!!!!!!! its VERY unpracticle.

anyways here's mine:
code:
var pic : int := Pic.FileNew ("Balloons.bmp")
if pic = 0 then
   put "Unable to load JPEG: ", Error.LastMsg
   return
end if
Pic.Draw (pic, 0, 0, picCopy)
var width : int := Pic.Width (pic)
var height : int := Pic.Height (pic)
var keep : array 1 .. width, 1 .. height of int
for i : 1 .. width
   for k : 1 .. height
       keep (i, k) := View.WhatDotColour (i, k)
   end for
end for
cls
var count : int := 0
for i : 1 .. width
   for k : 1 .. height

       var filenumber : int
       var fn : string := "tob"
       var one_entry : string := "Draw.Dot (" + intstr (i) + ", " + intstr (k) + ", " + intstr (keep (i, k)) + ")"

       open : filenumber, fn, write, mod, seek
       seek : filenumber, count
       write : filenumber, one_entry
       close : filenumber
       var l : int := length (one_entry)
       count := count + l + 2
   end for
end for


in this program just change the name "balloon.jpg" to whatever your pic is called. also the pic has to be in the same folder as the turing program.

Cheers
TheXploder




PostPosted: Fri Jan 30, 2004 10:52 am   Post subject: (No subject)

I don't get why you would need GIF's a series of BMP's would work aswell, I made an example here:


Animation.zip
 Description:

Download
 Filename:  Animation.zip
 Filesize:  2.4 KB
 Downloaded:  280 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Paul




PostPosted: Fri Jan 30, 2004 11:31 am   Post subject: (No subject)

I dunno, can bmp's be animated on the net? I've only seen animated GIF's on the net.
shorthair




PostPosted: Fri Jan 30, 2004 11:48 am   Post subject: (No subject)

I think thats the whole point , im not sure about the whole thing , but i think the point is that it only truly works for GIF's , im sure by now if it did work , peopel would be using jpg and bmp animators ,i but im probably wrong , im gonna go google the whole situation
Mazer




PostPosted: Fri Jan 30, 2004 11:54 am   Post subject: (No subject)

The point is this:
JPG's and Bitmaps were never designed to be animated. To be used as frames in an animation, sure, but never to be a single animated file on their own. Bitmaps are just basic image files, and the whole purpose of the JPG is compression and quality. If you have a large image with a large range of colours, you could keep it as a bitmap and have no loss of quality, or compress as a JPG or GIF. As a JPG it would have good compression with little loss to quality, and as a GIF it would have great compression and crap quality. That's why GIF images are almost always used when there are very few colours. As for using GIF images for transparencies, that really sucks. There's a better version (PNG) for using transparency (in fact, it has true alpha transparency) but for some reason people who make browsers don't want to implement them properly. Rolling Eyes
shorthair




PostPosted: Fri Jan 30, 2004 11:58 am   Post subject: (No subject)

Thanks For Clearing that up mazer , i totally forgot about quality and Compression ,
santabruzer




PostPosted: Fri Jan 30, 2004 5:06 pm   Post subject: (No subject)

now then.. thank you for all of your suggestions.. but i dunnu.. i just don't think i correctly stated what i wanted.. i don't need to create a file.. i want to open lets say the JPG compression, and save it as a JPG compression, as a true photo editor could do it.. all i wonder now, that i searched up JPG compressions and format on the internet, is if turing can handle reading and drawing the image by reading the file.. not using Pic.Draw..... and using drawdot after that information from the image was aquired.. now is that possible Razz
AsianSensation




PostPosted: Fri Jan 30, 2004 6:02 pm   Post subject: (No subject)

didn't rizzix make something like that? A very good one too that could do many many things, I don't know where it is now, but try to find it, it was very very good.
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  [ 14 Posts ]
Jump to:   


Style:  
Search: