Solved

displaying a device independent bitmap

Posted on 1998-12-28
4
235 Views
Last Modified: 2010-05-03
I need to display a device independent bitmap. I have a function that reads a gif or jpg and returns a valid handle to a dib - but how do I then display it in a form? I can't find a vb call or component that takes an hDIB. I don't want to use BitBlt if I don't have to. And besides, all I have is a handle to the dib, not a device context. BitBlt requires a source device context. I guess I could use the API call and create one then stick the hDib into the device context but that's heading me back to BitBlt which I'd rather avoid.
0
Comment
Question by:charlesj
  • 2
4 Comments
 
LVL 4

Expert Comment

by:idcanada
Comment Utility

Does the picture control solve your problem?

Maybe if you could post more information...

0
 

Author Comment

by:charlesj
Comment Utility
Nope, the picture control does not solve the problem. I looked at it and the image control first of all. You can retrieve the image property (picture property) from them but I need to set it. And the only way you can set the graphic for those controls is to provide a path to a file. I have a gif file which I have converted into a handle to a dib, now I need to display that dib.
0
 
LVL 2

Accepted Solution

by:
VBDesigns earned 200 total points
Comment Utility
I believe you're looking for the StretchDIBits API.  Give that a try!

0
 

Author Comment

by:charlesj
Comment Utility
Thanks VBDesigns. That was the trick.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 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

11 Experts available now in Live!

Get 1:1 Help Now