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

Username:   Password: 
 RegisterRegister   
 Pic slowly drawn and slowly fade help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Dudewhatzup1




PostPosted: Tue May 03, 2005 8:11 pm   Post subject: Pic slowly drawn and slowly fade help

How do you load a picture slowly and make it fade slowly?

for example like a pic like my avatar and make it slowly fade in and then slowly fade out ...
i know how to make text slowly fade in and fade out but not pics like this i am not looking for the sprinkle effect but a line by line change :S if anyone understood that....
Sponsor
Sponsor
Sponsor
sponsor
jamonathin




PostPosted: Wed May 04, 2005 6:56 am   Post subject: (No subject)

if you mean showing a 1 pixel line at a time, you can just do a for loop like this, and play with the delays and colors.
Turing:

var pic : int := Pic.FileNew ("light.jpg")
setscreen ("offscreenonly")
for decreasing i : Pic.Height (pic) .. 1
    cls
    Pic.Draw (pic, 0, 0, picCopy)
    drawfillbox (0, 0, Pic.Width (pic), i, white)
    View.Update
    delay (1)
end for


Or if this is the line thing you mean.
Turing:

var pic : int := Pic.FileNew ("light.jpg")
var line : array 1 .. Pic.Height (pic) of int
for i : 1 .. upper (line)
    line (i) := 1
end for
setscreen ("offscreenonly")
loop
    cls
    line (Rand.Int (1, upper (line))) := 0
    Pic.Draw (pic, 0, 0, picCopy)
    for i : 1 .. upper (line)
        if line (i) = 1 then
            drawline (0, i, Pic.Width (pic), i, white)
        end if
    end for
    View.Update
    delay (1)
    exit when hasch
end loop


And there's plenty more you can do, juss be creative. Smile
Dudewhatzup1




PostPosted: Wed May 04, 2005 10:44 am   Post subject: (No subject)

THANKS ALOT *cries out of joy* lol ... there is a problem i think im just stupid (like ur signiture says Laughing ) but how come when i try to run it it says somethign like "Illegal picture ID number "0". (probable cause: picture was not sucessfully created)"

????????????? Confused :S
Cervantes




PostPosted: Wed May 04, 2005 7:47 pm   Post subject: (No subject)

The probable cause for such an error is the picture was not successfully created. Wink Do you have a picture of the same file name in the same folder as the Turing program? Or, did you enter the full path correctly?
jamonathin




PostPosted: Wed May 04, 2005 8:30 pm   Post subject: (No subject)

Dudewhatzup1 wrote:
THANKS ALOT *cries out of joy* lol ... there is a problem i think im just stupid (like ur signiture says Laughing )

Yeah no problem, lol, but I think you misunderstand my signiture. Its used to refer to people who make something complex where it is not needed, or at least that's what I get from it. Confused
Bacchus




PostPosted: Thu May 05, 2005 5:46 am   Post subject: (No subject)

Occam's razor
Dudewhatzup1




PostPosted: Thu May 05, 2005 11:04 pm   Post subject: (No subject)

wut was that all about? "...razor?"

and... My bad i meant how u slowly fade in and out pixel by pixel Razz Embarassed

has it something to do with RGB.get color or pic file.new? :S Confused
Bacchus




PostPosted: Fri May 06, 2005 5:53 am   Post subject: (No subject)

[url=http://en.wikipedia.org/wiki/Occam's_Razor]Occam's Razor[/url] basically, when there are many ways to do something, the simplest way tends to be the best[/url]
Sponsor
Sponsor
Sponsor
sponsor
fabulos




PostPosted: Fri May 06, 2005 6:55 pm   Post subject: (No subject)

what if u want the pic to fade in...as a whole and not from any direction...


how do u do dat..?
fabulos




PostPosted: Sat May 07, 2005 9:50 am   Post subject: (No subject)

if i want to put antoher picture on top of the one i just faded in...how would i do dat...

p.s. i don't want this picture to fade in or sumthin...just drawn on top of the previous once dat's done fading in...
strike_hawk89




PostPosted: Sun May 08, 2005 4:18 pm   Post subject: (No subject)

sry if u think im a noob but i cannot get those codes to work. I changed the pic name to one on my comp, but it still didnt work. the error message is :
Illegal picture ID number "0". (Problem cause: picture was not successfully created.).
Cervantes




PostPosted: Sun May 08, 2005 4:44 pm   Post subject: (No subject)

Check that the file name is right. Check that the file is in the same folder as the turing file. Check that your file is of the allowable extensions (no .gifs!)
strike_hawk89




PostPosted: Sun May 08, 2005 5:50 pm   Post subject: (No subject)

i did all that and it still doesnt work. i even copy and pasted the code from the help menu and it still gives the same error message as before. to be more specific, the error is on the line "Pic.Draw (picID,..."
code:
var picID: int
        var x, y : int
       
        picID := Pic.FileNew ("Himeji.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)
jamonathin




PostPosted: Sun May 08, 2005 5:57 pm   Post subject: (No subject)

If you're just going to use "Himeji.bmp" or w/e then here's how you can figure out where that picture need to be. make a new file, and save it, where ever you save that file, "Himeji.bmp" has to be there in that exact same folder. Make sure you include very capital.
strike_hawk89




PostPosted: Sun May 08, 2005 6:03 pm   Post subject: (No subject)

thanks, finally got it to work. Very Happy Very Happy Very Happy
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  [ 15 Posts ]
Jump to:   


Style:  
Search: