Localizing images - how to?

T

Thomas

Hi all,

How do I localize images in my ASP.Net 3.5 application?

OK, I know I can put image URLs in the *.resx file under App_GlobalResources
and then use it in, let's say, my image button like this:
<asp:ImageButton ImageUrl=<%$ Resources:URLs, OKImage %> ...
I could even localize just part of the URL (folder) but this is not what I
am looking for.

Since there is a way to add images to the *.resx file itself there must be
some better way way to use them.

Google reveals million examples on how to localize strings but I found
nothing on images.

Thanks for any pointers.

Thomas
 
G

Gregory A. Beamer

Thomas said:
Hi all,

How do I localize images in my ASP.Net 3.5 application?

OK, I know I can put image URLs in the *.resx file under
App_GlobalResources and then use it in, let's say, my image button like
this:
<asp:ImageButton ImageUrl=<%$ Resources:URLs, OKImage %> ...
I could even localize just part of the URL (folder) but this is not what I
am looking for.

Since there is a way to add images to the *.resx file itself there must be
some better way way to use them.

Google reveals million examples on how to localize strings but I found
nothing on images.

You can use an image on resource assembly, similar to this windows app:
http://www.codeproject.com/KB/dotnet/Extracting_Embedded_Image.aspx

The "difficult" part is streaming out the image rather than just binding to
a URL.

Personally, I am not sure I understand the purpose of hard coding images for
a web app and then creating a complex mechanism to spit them out, but
perhaps there is one?

NOTE: It will likely be easier if you derive a class from asp:Image and then
spit the actual image directly to the response stream.

I would rethink the image URL idea, however, as it is far more flexible.

--
Peace and Grace,
Greg

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

************************************************
| Think outside the box! |
************************************************
 

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