Solved

use DLL resource to fill picturebox

Posted on 1998-12-05
2
133 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
[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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

749 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