how do you make a picture fade?
Author |
Message |
BPhelmet
|
Posted: Sun Dec 12, 2004 10:40 pm Post subject: how do you make a picture fade? |
|
|
you know the Pic.Draw pictures
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Neo
|
Posted: Sun Dec 12, 2004 11:08 pm Post subject: (No subject) |
|
|
code: |
View.Set ("graphics:200;160,nobuttonbar,nocursor,noecho")
Draw.FillBox (0, 0, maxx, maxy, black)
Draw.FillOval (98, 77, 71, 71, yellow)
Draw.FillOval (75, 104, 15, 15, blue)
Draw.FillOval (116, 103, 14, 14, blue)
Draw.FillArc (93, 63, 32, 32, 180, 0, blue)
loop
drawdot (Rand.Int (0, maxx), Rand.Int (0, maxy), black)
end loop |
|
|
|
|
|
|
beard0
|
Posted: Sun Dec 12, 2004 11:09 pm Post subject: (No subject) |
|
|
You're going to have to use the RGB commands. Read in the pixels, one by one, into an array, then draw the pixels with RGB values 10% closer to 0. Repeat 10 times. You'll want to do offscreen stuff, cause it will take a while. You may even want to first generate all the pictures you need, so that when you want to fade, you can do so quickly.
|
|
|
|
|
|
beard0
|
Posted: Sun Dec 12, 2004 11:38 pm Post subject: (No subject) |
|
|
Here's what I was talking about:
Description: |
There is a fade procedure with demo using included pic |
|
Download |
Filename: |
fade demo.zip |
Filesize: |
2.52 KB |
Downloaded: |
146 Time(s) |
|
|
|
|
|
|
BPhelmet
|
|
|
|
|
BPhelmet
|
Posted: Mon Dec 13, 2004 10:13 pm Post subject: (No subject) |
|
|
but it is not very good with big pictures is it?
|
|
|
|
|
|
BPhelmet
|
Posted: Mon Dec 13, 2004 10:19 pm Post subject: (No subject) |
|
|
and um....... why is it so slow when doing a big picture?
|
|
|
|
|
|
Delos
|
Posted: Mon Dec 13, 2004 10:58 pm Post subject: (No subject) |
|
|
A "big" picture is something that has a lot of pixels. Say it is 100 pixels by 100 pixels. Thats 100^2 = 10 000 pixels. That means, the programme has to go through 10 000 loops initially to read the RGB values, then again to calculate and setup the new ones, reiterating as many times as needed.
Once you get to something like 640x480...you're talking 300 000+ pixels to deal with. Using this forceful algorithm (these are usually the easiest, but lack finesse), that's a lot of work for the cpu to do.
I've also got a feeling that if OOT were able to access Graphics Cards, thing would be faster, but that's just speculation on my part. I have not the expertise nor experience to verify it...quite likely that others do!
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
BPhelmet
|
Posted: Tue Dec 14, 2004 7:35 pm Post subject: (No subject) |
|
|
is there any other way?
|
|
|
|
|
|
beard0
|
Posted: Tue Dec 14, 2004 9:40 pm Post subject: (No subject) |
|
|
For a nice progressive fade? No, not that I know of.
You could however use the "speckle-fade" method shown by Neo for something faster.
|
|
|
|
|
|
BPhelmet
|
Posted: Wed Dec 15, 2004 9:38 pm Post subject: (No subject) |
|
|
i guess i'll use that then
|
|
|
|
|
|
|
|