Solved

use DLL resource to fill picturebox

Posted on 1998-12-05
2
130 Views
Last Modified: 2012-08-14
i use Borland REsource Workshop to make a DLL resource.
i got 1 bmp file (file type BMP, file name BMP1) and 1 JPEG file (file type JPG, filename JPG1). (note bmp is default support by the borland workshop, while jpeg is user define).

how can i use the above picture file to fill let say picturebox1 in VB ?

i have asked this question at many different forums and mailing lists, but now yet been answered for year. hope someone can answer this question here.

thanks for help
keong
0
Comment
Question by:hckhiu
2 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 170 total points
ID: 1448393
I am not sure about the JPEG, but you can do this to get the BMP:
1. LoadLibrary to load the dll.
2. FindResource to get the resource handle
3. LoadResource to load the resource itself, to get the handle to the bitmap
4. CreateDC and SelectObject with the returned handle to select the bitmap into the new device context.
5. BitBlt to output it

Tell me if you need any help
0
 
LVL 15

Expert Comment

by:ameba
ID: 1448394
The best way is to use .RES format in Resource Workshop, and add .RES file to your VB project.
There is VB example in your vb5\samples\PGuide\ATM directory.
It shows how to load picture, cursor, sound or string from your Resource file.

For dlls, it is not that simple. LoadResource is complicated (you must also use LockResource and UnLockResource...). There are easier API functions for each type of resource (e.g. LoadBitmap, LoadIcon, LoadCursor...)

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Vb.net 2008 2 56
A macro to Count the number of rows across all worksheets 3 84
passing parameter in sql procedure 9 56
Add and format columns in vb6 7 47
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

867 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

16 Experts available now in Live!

Get 1:1 Help Now