473,387 Members | 1,619 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,387 software developers and data experts.

How to access "DefaultNamespace"

I added a bitmap file to my project in the Soultion Explorer window. I set
the Build Action property on the bitmap file to Embedded Resource. The
Project Properties, File Properties help item says "The identifier will be
namespace.filename.extension, where namespace is the value of the
DefaultNamespace property in a Visual C# project". So, how do I access
DefaultNamespace?

Thanks in advance,
Richard Wilder
(C# noob)
Feb 7 '06 #1
5 1945
Right-click on the Project in Solution Explorer, and choose "Properties". The
default namespace should be visible on the third line.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ri*****@nospam.nospam" wrote:
I added a bitmap file to my project in the Soultion Explorer window. I set
the Build Action property on the bitmap file to Embedded Resource. The
Project Properties, File Properties help item says "The identifier will be
namespace.filename.extension, where namespace is the value of the
DefaultNamespace property in a Visual C# project". So, how do I access
DefaultNamespace?

Thanks in advance,
Richard Wilder
(C# noob)

Feb 7 '06 #2
Thanks Peter,
I want to pass that to TextureLoader.FromFile as the FileName parameter but
FileName is supposed to be a string. If I try
"TextureTutorial.SpinButtonl.bmp" as the parameter I get a runtime exception
if I just try TextureTutorial.SpinButtonl.bmp (sans quotes) I get a compile
error that says SpinButtonl does not exist in TextureTutorial... I'm just
trying to load a bitmap that happens to be a resource into my texture so I
don't have to keep a bunch of bmps around when I deploy. Any idea how that's
done?

Thanks,
Richard Wilder
"Peter Bromberg [C# MVP]" wrote:
Right-click on the Project in Solution Explorer, and choose "Properties". The
default namespace should be visible on the third line.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


Feb 7 '06 #3
Not exactly sure what you need, but if you just want to add the bitmap files
to your project and in their properties set them as "embedded resource" you
can get them out of the assembly easily with GetManifestResourceStream method
of the Assembly class.
You can use GetManifestResourceNames to return a string array of their exact
names if you need it.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ri*****@nospam.nospam" wrote:
Thanks Peter,
I want to pass that to TextureLoader.FromFile as the FileName parameter but
FileName is supposed to be a string. If I try
"TextureTutorial.SpinButtonl.bmp" as the parameter I get a runtime exception
if I just try TextureTutorial.SpinButtonl.bmp (sans quotes) I get a compile
error that says SpinButtonl does not exist in TextureTutorial... I'm just
trying to load a bitmap that happens to be a resource into my texture so I
don't have to keep a bunch of bmps around when I deploy. Any idea how that's
done?

Thanks,
Richard Wilder
"Peter Bromberg [C# MVP]" wrote:
Right-click on the Project in Solution Explorer, and choose "Properties". The
default namespace should be visible on the third line.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

Feb 8 '06 #4
Thanks again for writing Peter.
OK, I got the name of the bitmap & it's "TextureTutorial.SpinButtonl.bmp".
Now I just need to load that bitmap into a texture. If it (SpinButtonl.bmp)
were a disk file I could just use myTexture =
TextureLoader.FromFile(myDevice, "SpinButtonl.bmp",...) to get the bitmap
into the texture. Is there a way to get the bitmap that's stored as a
resource into a texture?

Thanks,
Richard Wilder

"Peter Bromberg [C# MVP]" wrote:
Not exactly sure what you need, but if you just want to add the bitmap files
to your project and in their properties set them as "embedded resource" you
can get them out of the assembly easily with GetManifestResourceStream method
of the Assembly class.
You can use GetManifestResourceNames to return a string array of their exact
names if you need it.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


Feb 8 '06 #5
> OK, I got the name of the bitmap & it's "TextureTutorial.SpinButtonl.bmp".
Now I just need to load that bitmap into a texture. If it
(SpinButtonl.bmp)
were a disk file I could just use myTexture =
TextureLoader.FromFile(myDevice, "SpinButtonl.bmp",...) to get the bitmap
into the texture. Is there a way to get the bitmap that's stored as a
resource into a texture?


Wouldn't this do ??

Assembly a = Assembly.GetAssembly(this.GetType());
Stream stream = a.GetManifestResourceStream(someResourceName);
TextureLoader.FromStream(myDevice, stream ,...)

Soren
Feb 8 '06 #6

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

Similar topics

5
by: CindyRob | last post by:
Using .NET framework 1.1 SP1, .NET framework SDK 1.1 SP1, Visual Studio .NET 2003, hotfixes 892202 and 823639. I create a proxy class using wsdl.exe, and in the serialized XML request, I see...
1
by: Martin Plechsmid | last post by:
Hello, (After investigating my real problem) I've got a C# web service containing a single method: public MyBDO Test() { return null; }
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.