473,224 Members | 1,635 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Adding bitmaps to project

Hi there, I have a couple of bitmaps that are called in my project that I
need to use. They were added to my solution as existing objects and are
located in the same folder as the rest of the vb files.

I set their Build Action to Embedded Resource and compiled without any
errors, however, when calling them, like this inside Initialize Components:

myclosebutton.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"),
Color.FromArgb(255, 0, 255), New Point(127, 8))

I get this error:

An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll
Additional information: Resource 'close.bmp' could not be found in class
'InnerView.InnerView.main'.

Help!???
Thanks,
Derek
Nov 20 '05 #1
6 3202
Derek:

off the top of my head, I'm not sure. I think you need to reference the
project though. Here's the style I use regularly to get the info (not
saying this is better, but it definitely works)
case ImageName.RecordDisabled:
return new
Bitmap(System.Reflection.Assembly.GetExecutingAsse mbly().GetManifestResource
Stream("Project.Resource.jpg"));
"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi there, I have a couple of bitmaps that are called in my project that I
need to use. They were added to my solution as existing objects and are
located in the same folder as the rest of the vb files.

I set their Build Action to Embedded Resource and compiled without any
errors, however, when calling them, like this inside Initialize Components:
myclosebutton.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"),
Color.FromArgb(255, 0, 255), New Point(127, 8))

I get this error:

An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll
Additional information: Resource 'close.bmp' could not be found in class
'InnerView.InnerView.main'.

Help!???
Thanks,
Derek

Nov 20 '05 #2
Hmmm...well, I tried something similar to that and also went and found some
examples on the internet, nothing seems to be different in my setup than the
examples.

My startup object isn't the form that these are in, could that be the
trouble?

Thanks!
Derek
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:OD****************@TK2MSFTNGP09.phx.gbl...
Derek:

off the top of my head, I'm not sure. I think you need to reference the
project though. Here's the style I use regularly to get the info (not
saying this is better, but it definitely works)
case ImageName.RecordDisabled:
return new
Bitmap(System.Reflection.Assembly.GetExecutingAsse mbly().GetManifestResource Stream("Project.Resource.jpg"));
"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi there, I have a couple of bitmaps that are called in my project that I need to use. They were added to my solution as existing objects and are
located in the same folder as the rest of the vb files.

I set their Build Action to Embedded Resource and compiled without any
errors, however, when calling them, like this inside Initialize

Components:

myclosebutton.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"),
Color.FromArgb(255, 0, 255), New Point(127, 8))

I get this error:

An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll
Additional information: Resource 'close.bmp' could not be found in class
'InnerView.InnerView.main'.

Help!???
Thanks,
Derek


Nov 20 '05 #3
I decided after fighting with it for quite some time to create a bitmap
right from within VS. Did an Add New Item, Bitmap File and saved it to the
solution. Properties set to Embedded Resource and changed the line to look
like this:
taskbarNotifier1.SetCloseBitmap(New Bitmap(MyClass.GetType(),
"Bitmap1.bmp"), Color.FromArgb(255, 0, 255), New Point(127, 8))
Same error - I MUST be doing something very small and wrong
consistently...anyone???

Thanks!
Derek
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:OD****************@TK2MSFTNGP09.phx.gbl...
Derek:

off the top of my head, I'm not sure. I think you need to reference the
project though. Here's the style I use regularly to get the info (not
saying this is better, but it definitely works)
case ImageName.RecordDisabled:
return new
Bitmap(System.Reflection.Assembly.GetExecutingAsse mbly().GetManifestResource Stream("Project.Resource.jpg"));
"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi there, I have a couple of bitmaps that are called in my project that I need to use. They were added to my solution as existing objects and are
located in the same folder as the rest of the vb files.

I set their Build Action to Embedded Resource and compiled without any
errors, however, when calling them, like this inside Initialize

Components:

myclosebutton.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"),
Color.FromArgb(255, 0, 255), New Point(127, 8))

I get this error:

An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll
Additional information: Resource 'close.bmp' could not be found in class
'InnerView.InnerView.main'.

Help!???
Thanks,
Derek


Nov 20 '05 #4
Derek: I just used your bitmap name and stuck it in a project called
WindowsApplication10. I added a bitmap I had and called it Close.bmp to
match your situation. Worked without a glitch..you may want to use this
syntax:

Dim testBitmap As New
Bitmap(Reflection.Assembly.GetExecutingAssembly.Ge tManifestResourceStream("W
indowsApplication10.Close.bmp"))

Me.Button1.Image = testBitmap

"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi there, I have a couple of bitmaps that are called in my project that I
need to use. They were added to my solution as existing objects and are
located in the same folder as the rest of the vb files.

I set their Build Action to Embedded Resource and compiled without any
errors, however, when calling them, like this inside Initialize Components:
myclosebutton.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"),
Color.FromArgb(255, 0, 255), New Point(127, 8))

I get this error:

An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll
Additional information: Resource 'close.bmp' could not be found in class
'InnerView.InnerView.main'.

Help!???
Thanks,
Derek

Nov 20 '05 #5
Okay, I got that working and that led me down a few more paths...I am
running the method that is calling my bitmap popup (see the toaster posts
below in NG if interested) in a thread which is not allowing it to push it
out correctly - jumps right over it.

SO - thanks so much for you help!!!! Now I just have to figure out how to
make that thing work in a thread and I am in business!

:-)

Derek
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
Derek: I just used your bitmap name and stuck it in a project called
WindowsApplication10. I added a bitmap I had and called it Close.bmp to
match your situation. Worked without a glitch..you may want to use this
syntax:

Dim testBitmap As New
Bitmap(Reflection.Assembly.GetExecutingAssembly.Ge tManifestResourceStream("W indowsApplication10.Close.bmp"))

Me.Button1.Image = testBitmap

"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi there, I have a couple of bitmaps that are called in my project that I need to use. They were added to my solution as existing objects and are
located in the same folder as the rest of the vb files.

I set their Build Action to Embedded Resource and compiled without any
errors, however, when calling them, like this inside Initialize

Components:

myclosebutton.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"),
Color.FromArgb(255, 0, 255), New Point(127, 8))

I get this error:

An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll
Additional information: Resource 'close.bmp' could not be found in class
'InnerView.InnerView.main'.

Help!???
Thanks,
Derek


Nov 20 '05 #6
By the way, to get it to work, I had to put the bmp in the exe directory of
the project and make this line:

taskbarNotifier1.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"),
Color.FromArgb(255, 0, 255), New Point(127, 8))
Say this instead:
taskbarNotifier1.SetCloseBitmap("close.bmp", Color.FromArgb(255, 0, 255),
New Point(127, 8))
It works, but the downside is, obviously, the bmp isn't included in the exe
file which would allow someone to change it and that's bad, but I cannot for
the life of me get that first line example to work.
Any ideas?
Thanks,
Derek
"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:Oz***************@tk2msftngp13.phx.gbl...
Okay, I got that working and that led me down a few more paths...I am
running the method that is calling my bitmap popup (see the toaster posts
below in NG if interested) in a thread which is not allowing it to push it
out correctly - jumps right over it.

SO - thanks so much for you help!!!! Now I just have to figure out how to
make that thing work in a thread and I am in business!

:-)

Derek
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:OQ**************@tk2msftngp13.phx.gbl...
Derek: I just used your bitmap name and stuck it in a project called
WindowsApplication10. I added a bitmap I had and called it Close.bmp to
match your situation. Worked without a glitch..you may want to use this
syntax:

Dim testBitmap As New

Bitmap(Reflection.Assembly.GetExecutingAssembly.Ge tManifestResourceStream("W
indowsApplication10.Close.bmp"))

Me.Button1.Image = testBitmap

"Derek Martin" <dm*****@DONTSPAMMEokstate.edu> wrote in message
news:ur**************@tk2msftngp13.phx.gbl...
Hi there, I have a couple of bitmaps that are called in my project that I need to use. They were added to my solution as existing objects and

are located in the same folder as the rest of the vb files.

I set their Build Action to Embedded Resource and compiled without any
errors, however, when calling them, like this inside Initialize

Components:

myclosebutton.SetCloseBitmap(New Bitmap(MyClass.GetType(), "close.bmp"), Color.FromArgb(255, 0, 255), New Point(127, 8))

I get this error:

An unhandled exception of type 'System.ArgumentException' occurred in
system.drawing.dll
Additional information: Resource 'close.bmp' could not be found in class 'InnerView.InnerView.main'.

Help!???
Thanks,
Derek



Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Greg Merideth | last post by:
I'm amazed that putting an icon next to a menu item using c#, even from within visual studio, is so damm difficult. Does anyone have any code samples or tutorials on how to do this, amazingly...
10
by: Geoff Jones | last post by:
Hiya I hope somebody can help me with this relatively simple beginner question: I have created a windows Application in C#. I have also created a project, which includes a class. I have added...
6
by: UJ | last post by:
I have a couple of files (type definitions, constants, ...) that I want to use in multiple projects. How do I make it so that I have only one copy of the file for multiple projects? If I do add...
2
by: Joe Wedel | last post by:
I have a Solution with 4 Projects, one of which is not loading. I get the error message: Microsoft Development Environment Unable to read the project file 'CouncilAgenda.vbproj'. The project...
3
by: _DS | last post by:
The two obvious methods for ref'ing assemblies are: Add a reference and 'Browse' for the actual DLL OR Add existing project to the solution, then add a ref to 'Project'. 1: I'd like to...
0
by: Nick Zdunic | last post by:
When creating a Web Setup Project in VS 2005 and adding the project output from a web project, it doesn't appear that the dependencies are being added. The folder is blank when there should be...
0
by: Maqsood Ahmed | last post by:
Hello, I have converted an application from .net 1.1 to .net 2.0. I added a Windows Installer project to the solution and all worked well. Now I want to bind the solution to source control (VSS...
1
by: Sala | last post by:
Hi creative thinkers ! I have one project in C# .. that project name ewaoNET . Now i will shifted into another project sub folders.... My current Project : Cititown Now i will use existing (...
0
by: Narasimham | last post by:
Hi, I was able to successfully create a new project using the devenv command line arguments. I did devenv /command np and then specified the name of the project and its location in the
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.