fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

How to manage resources in XIDE 10 Jul 2017 06:14 #2067

  • wriedmann's Avatar

  • wriedmann

  • Topic Author


  • Posts: 2349
  • Hello,

    since I had some difficulties to understand how to add resources in XIDE to use them in my X# program, I wrote a small test program. But there is also other people that has the same understanding problems.
    Therefore I would like to post it here.
    1) "Add existing" - "Add resource files"
    You can retrieve it with:
    oAssembly := Assembly.GetExecutingAssembly()
    oBitmap	:= Bitmap{ oAssembly:GetManifestResourceStream( "blue.png" ) }
    2) "Create new" - "New resource file"
    oResourceManager := System.Resources.ResourceManager{ "bitmap", oAssembly }
    oObject := oResourceManager:GetObject( "red.png" )
    if oObject is Bitmap
      oBitmap := ( Bitmap ) oResourceManager:GetObject( "red.png" )
    endif

    You can find the complete working code including samples how to list the resources as XIDE export file here:

    ResourcesSample.zip

    Hope to help someone.

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Last edit: by wriedmann. Reason: Typo

    How to manage resources in XIDE 10 Jul 2017 08:55 #2073

  • FFF's Avatar

  • FFF


  • Posts: 1008
  • Wolfgang,
    cool, and thx for the embedded link to MS doc.
    One question: in the article he mentions

    "...use of an alternate resource name after the comma of the file name to be embedded. The alternate resource name allows you to provide arbitrarily period-nested names for resources, regardless of the name of the file. It's the alternate name that makes it into the assembly..."

    If i'd like to do so, how/where could i add the alternate name in Xide?

    TIA
    Karl
    Regards
    Karl (X# 2.6; Xide 1.26; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    How to manage resources in XIDE 10 Jul 2017 09:08 #2074

  • wriedmann's Avatar

  • wriedmann

  • Topic Author


  • Posts: 2349
  • Hi Karl,

    I'll do some tests, maybe speak with Chris, and let you know in the next days.

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    How to manage resources in XIDE 10 Jul 2017 09:27 #2075

  • FFF's Avatar

  • FFF


  • Posts: 1008
  • No hurry, asked only of curiosity ;)
    Regards
    Karl (X# 2.6; Xide 1.26; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    How to manage resources in XIDE 10 Jul 2017 15:50 #2080

  • Chris's Avatar

  • Chris


  • Posts: 2126
  • Hi Karl,

    Hmm, that's not support at the moment, but I can add an option in the resource file item for specifying the namespace. If you needed to do that now, you would have to specify the resource via a direct /resource compiler option (in the general options editbox of the app properties). The syntax of the compiler switch in x# is exactly the same as in c#.

    Chris
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    How to manage resources in XIDE 11 Jul 2017 07:47 #2087

  • wriedmann's Avatar

  • wriedmann

  • Topic Author


  • Posts: 2349
  • Hi Chris,

    thank you very much! So I don't need to investigate more at this time. (it's not that I have too much time <g>)

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1