Link to home
Start Free TrialLog in
Avatar of ginsonic
ginsonicFlag for Romania

asked on

TV no signal FX

Hy to all,
I need to create a TV no stignal effect animation .
U know : many random pixels whites, blacks and gry .
And I need speed too . Can anybody help me ?

For example , to create in a rectangle with widh:=320 , height:=240 this FX .
Avatar of TheNeil
TheNeil

Nick,

I take it my solution wasn't fast enough. What you could do is pregenerate an array of pixel values and then just iterate through that:

VAR
  PreGen : ARRAY [0..512] OF TColor;
....
BEGIN

rGrey_Step := 255 / iNo_Greys;
FOR n := 0 TO 512
DO
BEGIN
  iLevel := ROUND(rGrey_Step * Random(iNo_Greys);
  preGen[n] := RGB(iLevel, iLevel, iLevel);
END;

//Initilaise as before

iCount := 0;
FOR m := 0 TO 240
DO
  FOR n := 0 TO 320
  DO
  BEGIN
    bmp.Canvas.Pixels[n, m] := preGen[iCount];
    iCount := (iCount + 1) MOD 512;
  END;

//Finalise as before
END;

Any good to you?

The Neil
Hi quinsonic :-)


So what you want is an effect just like a TV set on an empty channel (snow)?

Why not do it like an animated gif does and just have say 3 images of the snow and swap them in and out...maybe at random... this should be fast
and easy :-)

3 gray scale bmps (8bit) should work... you could use small ones and 'stretch' them somewhat to fit the area you need... I did a small animation this way and it was fast and flicker free.
Avatar of ginsonic

ASKER

Gwena ,
I use a big image . And I think that a code FX is more professional :)
Sorry Neil but don't work . And is far from what I wish .  
The noise of TV must be bigger than a pixel . And U use many dark color .
I see many demos in Pascal ( unfortunally I don't have anymore ) . Very quickly and cool . I think that use ASM ?!?!.

If U see C&C series games U know the FX .

Regards,
Nick
ASKER CERTIFIED SOLUTION
Avatar of hbrasch
hbrasch

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Heinz,
If you can see me how can enlarge the pixel , the points are your's .
hmm... lets see ...
try this one ....

instead of canvas.draw(0,0,display);

canvas.stretchdraw(rect(0,0,640,480),display);

this might help....

Heinz
Thanks hbrasch