Solved

displaying a device independent bitmap

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
MsgBox 2 59
VBA filters 2 64
VB 6 error 5 in windows 10 but not in XP 7 63
Fastest way to find and count same items VB6 16 23
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

856 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