[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

TV no signal FX

Posted on 2000-02-04
8
Medium Priority
?
365 Views
Last Modified: 2010-04-04
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 .
0
Comment
Question by:ginsonic
8 Comments
 
LVL 5

Expert Comment

by:TheNeil
ID: 2490599
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
0
 
LVL 5

Expert Comment

by:Gwena
ID: 2491123
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.
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2492196
Gwena ,
I use a big image . And I think that a code FX is more professional :)
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
LVL 9

Author Comment

by:ginsonic
ID: 2492231
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
0
 

Accepted Solution

by:
hbrasch earned 400 total points
ID: 2496223
hello,

try this one ... very low cpu utilisation.

At tform1.create add:

 display:=Tbitmap.create;
 display.width:=320;
 display.height:=240;
 display.pixelformat:=pf24bit;

and then ....

Procedure Tform1.Noisy;
type Trgb = record
       b,g,r : byte;
     end;

     trgbarray = array [0..1024] of trgb;
     prgbarray = ^Trgbarray;

var x,y:integer;
    dst: prgbarray;
    n    : byte;
begin

     randomize;
     for y:=0 to display.height-1 do
     begin
          dst:=display.scanline[y];
          for x:=0 to display.width-1 do
          begin
               n:=random(1024+x+y);
               dst[x].r:=n;
               dst[x].g:=n;
               dst[x].b:=n;
          end;
     end;
     canvas.draW(0,0,displaY);
end;

an improvement could be made with
stretchblt or stretchdraw to enlarge
the pixel.

okay, that´s it

Heinz

0
 
LVL 9

Author Comment

by:ginsonic
ID: 2497372
Heinz,
If you can see me how can enlarge the pixel , the points are your's .
0
 

Expert Comment

by:hbrasch
ID: 2497394
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
0
 
LVL 9

Author Comment

by:ginsonic
ID: 2499254
Thanks hbrasch
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
There may be issues when you are trying to access Outlook or send & receive emails or due to Outlook crash which leads to corrupt or damaged PST file. To eliminate the corruption from your PST file, you need to repair the corrupt Outlook PST file. U…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question