Solved

displaying a device independent bitmap

Posted on 1998-12-28
4
243 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
ID: 1452798

Does the picture control solve your problem?

Maybe if you could post more information...

0
 

Author Comment

by:charlesj
ID: 1452799
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
ID: 1452800
I believe you're looking for the StretchDIBits API.  Give that a try!

0
 

Author Comment

by:charlesj
ID: 1452801
Thanks VBDesigns. That was the trick.
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

770 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