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
177 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This is about my first experience with programming Arduino.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now