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
184 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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

724 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