PDA

Click to See Complete Forum and Search --> : Picture Buffer


apman
Aug 17th, 2001, 12:25 AM
Hi,

Here's what I need to do:

I have a 200 x 200 pixel image in a string... In other words I have each pixel separated as a long in the string with a space in between (3252124 1244124 3243244 etc...).

I can use the setpixel API to draw it onto the form. But this is slow and you can see the picture being drawn line by line.

What I need to do is draw the picture in a buffer and then blit it onto the screen. But I can only figure out how to blit a picture in a picturebox... Meaning I would have to draw the picture to the picturebox and then blit it..... but this is just as slow.

I've figured out that it is slow because setting the pixels one by one locks the video cards graphics buffer. If I were to put it together in a buffer... then the graphics buffer would not be in use... then I could blit it to the screen really fast.

Does anyone know how I can put together the picture in the buffer?

Thanks in Advance,
Alan

Brykovian
Aug 17th, 2001, 08:06 AM
Check out the pointer method (#4) in this tutorial ...
http://rookscape.com/vbgaming/tutAY.php

Does that help?

-Bryk

apman
Aug 17th, 2001, 08:51 AM
Hmm... looks interesting...

I guess if I convert the longs into RGB then I should be able to get the same effect.

I'll having some problems with the code... I'll post my results when I get them resolved.

-- Alan