Localizing images - how to?

Discussion in 'ASP .Net' started by Thomas, Feb 10, 2010.

  1. Thomas

    Thomas Guest

    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
     
    Thomas, Feb 10, 2010
    #1
    1. Advertising

  2. "Thomas" <> wrote in message
    news:...
    > 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! |
    ************************************************
     
    Gregory A. Beamer, Feb 11, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Philipp Sumi
    Replies:
    2
    Views:
    345
    Philipp Sumi
    Jul 23, 2003
  2. Trapulo

    localizing ax external template

    Trapulo, Feb 6, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    551
    ponyryd
    Aug 4, 2006
  3. =?Utf-8?B?S2VubnkgTS4=?=

    Performance issue localizing

    =?Utf-8?B?S2VubnkgTS4=?=, Mar 22, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    336
    =?Utf-8?B?S2VubnkgTS4=?=
    Mar 22, 2006
  4. Chris

    Localizing dates

    Chris, Jan 28, 2005, in forum: Java
    Replies:
    9
    Views:
    430
    Tony Dahlman
    Feb 22, 2005
  5. Chris

    Localizing dates

    Chris, Jan 28, 2005, in forum: Java
    Replies:
    1
    Views:
    458
Loading...

Share This Page