Bitmap problem

A

Aris

I have created a .dll file which creates a form with a
picturebox and a bitmap in it.I create an instance of the
dll from a project but I get an exception FileNotFound
My code is:

this.bitmap = new Bitmap(the path along with the bitmap
file);
pictureBox1.Image = bitmap;

Actually, I have added the bitmap file in the dll project,
not the application project that I use to test the dll,
and I select Build Action:Content.

Thanks
 
S

Suresh Venkatraman

Are you embedding the bitmap into the dll? If so then you may have to use
Assembly.GetManifestResourceStream to extract the bitmap.

--------------------
-Suresh Venkatraman [msft]

This posting is provided "AS IS" with no warranties, and confers no rights
--------------------
| Content-Class: urn:content-classes:message
| From: "Aris" <[email protected]>
| Sender: "Aris" <[email protected]>
| Subject: Bitmap problem
| Date: Tue, 2 Sep 2003 15:44:30 -0700
| Lines: 14
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcNxo8XOc+G+DOkzToSGNUf+bWv0iA==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.compactframework
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.compactframework:32568
| NNTP-Posting-Host: TK2MSFTNGXA09 10.40.1.161
| X-Tomcat-NG: microsoft.public.dotnet.framework.compactframework
|
| I have created a .dll file which creates a form with a
| picturebox and a bitmap in it.I create an instance of the
| dll from a project but I get an exception FileNotFound
| My code is:
|
| this.bitmap = new Bitmap(the path along with the bitmap
| file);
| pictureBox1.Image = bitmap;
|
| Actually, I have added the bitmap file in the dll project,
| not the application project that I use to test the dll,
| and I select Build Action:Content.
|
| Thanks
|
 
A

Aris

Do you mean to select "Embedded Resource" as build action
in the dll project and add
Assembly.GetManifestResourceStream to the application
project?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top