[Last Call] Learn how to a build a cloud-first strategyRegister Now

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
?
203 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
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

829 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