pictures

Started by
8 comments, last by paulecoyote 17 years, 6 months ago
Where do I save pictures in Microsoft Visual C# 2005 so that I can call them up using DirectX? Thanks
Advertisement
I think you will need to be a bit more specific [smile]

Are you trying to add images as resources stored in your exe and then use them as DirectX textures at runtime?

Or...

Are you wanting to know where you should put your images, relative to your exe, so you can find and load them during runtime and then use them as DirectX textures?

Regards,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
I'm not sure which of your two examples it is, but here is the code im trying to use to add the texture. Maybe you can help me.


texture = TextureLoader.FromFile(device, "texture.bmp");
That would be the latter [smile]

You don't actually need to add the image file to Visual C# 2005, just put the image file (texture.bmp) in the same folder as the .exe you create when you compile your code (the .exe should be created in the project's debug folder by default).

That should at least get you going for the time being [smile]

Regards,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
ok, three things.



1)thanks.

2) I went to my project and into the bin/debug folder and there are two executables there.

One is texture tut.vshost
the other is WIndowsApplication1.vshost

Are either of these what I'm looking for?

3) When I go to save the texture to that folder, (gasp) it appears that nothing is there!


EDIT: also, this is the error i'm getting
"Windows Application 1 has encountered a problem and needs to close. We are sorry for the inconvenience." However, visual studios itself doesnt close.
Maybe where i'm saving the pictures has nothing to do with it, but I assumed that is what it was because I only get these errors on tutorials where i need to use textures.

[Edited by - omgh4x0rz on September 27, 2006 8:39:29 AM]
This is the error signature. Maybe that can help someone figure out what is going wrong?

EventType : clr20r3 P1 : riemers tut.exe P2 : 1.0.0.0 P3 : 451a8270
P4 : microsoft.directx.direct3dx P5 : 1.0.2911.0 P6 : 442d82b0
P7 : 99a P8 : 55 P9 : 1qefl45lesjd2koisaejiad2poa0w3ty
Edit: sorry double post
Does your code even compile without error? The vshost is used by Visual Studio to improve the performance when debugging and is not the final compiled exe of your code/project.

If those are the only exe's you have in your bin folder then it would appear your code contains errors or is missing reference assemblies to build correctly.

The only thing I can guess at from the "error signature" you posted, is you are trying to follow the tutorials on riemers.net and not having much success. Perhaps if you post your source code here in [source][/source] tags we will be able to see what is going wrong but it does look like you are already getting ample help in Riemer's forums [smile]

Regards,
ViLiO
Richard 'ViLiO' Thomasv.net | Twitter | YouTube
Yes, that is exactly what I'm trying to do. Previously I had been building the project then using "start without debugging" on all the other tutorials, and they all worked fine until I tried adding the texture. I just tried "start debugging" and for some reason it worked (although still doesn't work the other way with the texture tutorial) Do you know why that might be?
It's probably because the working directory isn't quite what you think it is.

You could either hunt around for the setting in Visual studio, or try your bitmap in the same place as your project, in the root of bin and finally the release / debug directory.
Anything posted is personal opinion which does not in anyway reflect or represent my employer. Any code and opinion is expressed “as is” and used at your own risk – it does not constitute a legal relationship of any kind.

This topic is closed to new replies.

Advertisement