Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Bobsta

How to blur surface in DD using VB

This topic is 6927 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to blur the whole surface using DirectDraw in 16 bit mode I only know VB and it doesn''t matter if it is slow as I am not doing it in a loop can any one tell me how to do it? (It would be great if you can tell me the code)

Share this post


Link to post
Share on other sites
Advertisement
You could size down to half the size of the image and resize up. Sometimes DX will filter the image when you size back up.

Share this post


Link to post
Share on other sites
if you can get access to individual pixels you can use this pseudocode


For each pixel in surface do
Get Pixel RGB components
Get average of every surrounding pixel
Get average of the pixel and the average of surrounding pixels
end for loop


if you want a blurred blurred image, repeat these steps more times

Share this post


Link to post
Share on other sites
How do I get each RGB component of each pixel
which directdraw function should I use?

GetLockedPixel only return the colour in long and I don''t know how to extrace each RGB form it

If I use GetPixelFormat then use the l?BitMask, I don''t know how to get the colour of each pixel.

Share this post


Link to post
Share on other sites
not sure how to do it in vb, in c i lock the surface, get pixel from the buffer and shift the values

huumm long = 32 bits. probly 0X00RRGGBB, try to get the values this way whit some bit manipulation

Share this post


Link to post
Share on other sites
I don''t understand that "0X00RRGGBB"

Can you show me how you do it in C
I may be able to get some clue to do it in VB

Share this post


Link to post
Share on other sites
I tried that but it doesn''t work when I try to get the average of each of the RGB component.

Also this method is really incredabily slow. Takes
more than 10 sec to blur the screen and the programmes looks like crushed. (as the surface is locked)

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!