Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Is it better to use HBITMAP or LPBITMAP as a pattern when working with/managing BITMAPs in a Windows application?

Posted on 2015-01-10
2
Medium Priority
?
195 Views
Last Modified: 2015-01-10
Hi:

I'm building an utility application which reads in a bitmap and then performs analysis on it.

As matter of implementation/design patterns, is it better to store, use and pass as a parameter an
HBITMAP or an LPBITMAP?

I know that I can retrieve an LPBITMAP from an HBITMAP via the GetObject() call.
I'm not sure how expensive it is to use that call repeatedly.

What's the more accepted practice to use?
HBITMAP or LPBITMAP?

Thanks,
JohnB
0
Comment
Question by:jxbma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 2000 total points
ID: 40542548
That will depend on whatr you want to do with that parameter. If you are already manipulating that bitmap and pass the data to a subroutine to process it, it'd be better to use a LPBITMAP, since the subroutine would have to call 'GetObject()' itself each time. If you are passing the parameter as merely an 'informational' value (i.e. not working on the data, a HBITMAP seems more appropriate. Windows will lock the data in memory internally when you call 'GetObject()'. On the other hand, that practice was recommended whan computers ran Win9x and had considerably less memory than today, so you might not even remotely run into issues, but it's always nicer to be easy on the OS' resources.
0
 
LVL 1

Author Closing Comment

by:jxbma
ID: 40542719
Cool. That's what I kind of thought.
Thx
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Starting up a Project

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question