Jump to content
  • Advertisement
Sign in to follow this  
Niksan

GDI BitBlt Vs StretchBlt

This topic is 4887 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

Hi, I wondered if any of you guys/gals knew the real difference between these two functions apart from the obvious, in that one of them rescales an image. It's just that I have two device contexts which are both 32bits, when I do a BitBlt I get a correctly displayed part of an image, so that's all good and working, but StretchBlt does a bizzare thing, in that it seems to change the image to 8bit and use windows standard pallette then goes back to 32bit for the final blit so poops up good and proper, so does anyone know why this would happen bearing in mind the two functions are supposed to be the same apart from the 'stretching' :) Many thanks in advance, Nik

Share this post


Link to post
Share on other sites
Advertisement
why do you think that?? That's alot to infer!


We have no problem using strechblt. We only use it with the SRCCPY rop though.

Cheers
Chris

Share this post


Link to post
Share on other sites
Thank you very much, that was my problem, I guess I should use better test material for my apps, going from a 1280x800 image to a 200x100 image using SRCCOPY didn't do a good job, as for my thinking of the 8bit conspiracy, it's the colors it was using just so happened to be my desktop colors. I'll go back in my corner now with my D hat, but thanks as it helped solve my problem..


SetStretchBltMode(HALFTONE) the missing link... thanks again...

Share this post


Link to post
Share on other sites
Be carefuly with using StretchBlt in anything that needs to be fast - it can vary widely in performance. On a machine with a 2.8 Pentium 4 with onboard graphics, a program using stretchblt was using 2% CPU. On a machine with dual Xeon processors and a Geforce 4, it was taking 99% of one CPU.

Changing the StretchBlt to BitBlt and doing the resizing manually inside the application fixed the problem (Though of course the cpu usage ended up very slightly higher since the software is doing more now).

Share this post


Link to post
Share on other sites
Noted, I'm just using it as a lazy way to create some thumbnails for images, thanks for the tip though.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!