Jump to content
  • Advertisement
Sign in to follow this  
Curin

ID2D1DeviceContext::DrawImage vs ID2D1DeviceContext::DrawBitmap

This topic is 1242 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'm just curious what the difference between ID2D1DeviceContext::DrawImage and ID2D1DeviceContext::DrawBitmap is and whether there is a reason to use one over the other. I realize Drawimage can use an effect, and DrawBitmap cannot, but other than that what are the uses of each as if DrawBitmap wasn't better in some respect I would doubt it would still exist in the library or that Drawimage wouldn't just take over drawbitmap.

 

Thanks in Advance,

Curin

Share this post


Link to post
Share on other sites
Advertisement
Well, one works with a Bitmap and the other with an Image. smile.png

Bitmaps are a "thing." They directly represent a grid of pixels that can be sampled.

Images are more conceptual. A Bitmap can be an Image, as can procedural sources of pixel data. A Bitmap is a specific type of Image, as is an Effect.

DrawImage can draw from any Image, be it a Bitmap or an Effect, while DrawBitmap of course can only draw from a Bitmap. There are performance gains to be had when you know you're blitting directly from a Bitmap and a handful of features that only make sense when you know the source is a Bitmap. You can't always know for sure if you're going to be given a Bitmap or an Effect, though, so sometimes drawing from an Image is necessary. Drawing from an Effect has other various advantages and disadvantages compared to drawing from a Bitmap.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!