Path: chuka.playstation.co.uk!news From: richard.cutting@virgin.net (Richard Cutting) Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: How do I manipulate Pixels? Date: Sat, 08 Aug 1998 00:08:46 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 57 Message-ID: <35cb9524.1641258@news.playstation.co.uk> References: <6qfcml$ldg12@chuka.playstation.co.uk> <35CB6109.CA39FA19@scee.sony.co.uk> NNTP-Posting-Host: p54-prion-gui.tch.virgin.net X-Newsreader: Forte Free Agent 1.11/32.235 On Fri, 07 Aug 1998 21:18:18 +0100, James Russell wrote: >Chris Searle wrote: >> >> As and example how would I rereate TV static, ie randomly setting each pixel >> as black or white ( rand()%2 , on or off). Please, please give me source its >> all I understand! > > >You can use the LoadImage and StoreImage commands to access VRAM memory from main memory. It >probably isn't the most efficient way to do this, but by duplicating areas you could get a quite >nice static effect (colour cycling would be better). > >Cheers, > >James > >-- >== James_Russell@scee.sony.co.uk +44 (171) 447-1626 >== Developer Support Engineer - Sony Computer Entertainment Europe > >Remember, Subaru spelled backwards is U-R-A-BUS. I was playing with this sort of thing myself recently. The way I found to muck about at the pixel level was something like the following ( and no it's not optimised .... ). This is for a 320 * 256 screen and doesn't take double buffering into account.... // Code starts unsigned long screen[320*256]; RECT scr; register int i; scr.x = 0; scr.y = 0; scr.w = 320; scr.h = 256; for( i = 0; i < 320 * 256; i++ ) { screen[i] = rand()%2; } LoadImage( &scr, screen ); // Code ends Obviously it can be a lot more efficient.........But you should get the idea....... Richard. http://www.netyaroze-europe.com/~rcutting