Solved

displaying a device independent bitmap

Posted on 1998-12-28
4
247 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Suggested Courses
Course of the Month4 days, 11 hours left to enroll

636 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