best way to work with fast picture modification?
I mean getting pixels and changing them...
SetPixel and GetPixel are preety slow...
so how to do it fast?
Dib sections should do what you're wanting.
I'm not sure what language you're working in, but the concepts should be similar in any.
If you're using vb, check here
if not, still check over there.
I assume you aren't doing anything that openGL or direct3d would help out in (or you just don't want to use them.)
-Michael
[edited by - thr33d on November 7, 2003 5:00:59 PM]
I'm not sure what language you're working in, but the concepts should be similar in any.
If you're using vb, check here
if not, still check over there.
I assume you aren't doing anything that openGL or direct3d would help out in (or you just don't want to use them.)
-Michael
[edited by - thr33d on November 7, 2003 5:00:59 PM]
One method is to make a DDB back buffer, and use the SetBitmapBits function to fill it from an array of pixels. The actual byte order/accuracy depends on the window you are outputing/desktop bitdepth/graphics card. You can do some silly little tricks to figure this out, by drawing a test array of colors in the array, and looking which looks like it should for the appropriate bit depth/byte order. in a 640x480 window.. this runs at about 120fps... giving you about 1/60 secs to do what you want to it, to get 40fps final performance (on my 1800 XP). I got a window full of noise going at 80fps (ie writing to every pixel on screen) so it should certinly be possibly. You could opt for a DIB and do the same, but this will almost certainly be slower (but a lot easier).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement