Embed image in DLL

Posted on 2005-04-12
Last Modified: 2013-12-26
Is it possible to embed an image (say, a GIF file) inside a DLL? like a VB executable would store a picturebox-control contents?

The DLL will be used by an ASP script to return an HTML string. I could just reference it by building the <img src> tag into the string and have the image stored separatley on disk, but I want the DLL to be completely self-contained.

I reckon it may be possible to do it by encoding the image in Base64, but I thought I would ask EE before I waste any time on it.
Any examples would be nice.
Question by:astromex
    LVL 10

    Accepted Solution

    You could store it in a resource file and output it as a byte array - or even write it out to a temp file as when you need it. I don't know if it possible to reference it in the <img src= ...> tag like that though.

    Author Comment

    Hi again fds_fatboy.
    I've not used resource files before, how do they work? I am using VB6 by the way.

    Re: the <img> tag,
    What I meant was that the DLL would output the string "<img src='images/logo.gif'>" and as long as the file "logo.gif" is in the "images" directory (within web scope), then the browser will display it.

    Author Comment


    Featured Post

    Courses: Start Training Online With Pros, Today

    Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Using Round (coverting VB6 code to SQL) 5 42
    Detect VBA Font Colors 15 46 Listview 9 67
    z = x + y – 1 6 49
    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
    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…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    746 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

    20 Experts available now in Live!

    Get 1:1 Help Now