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

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

764 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