How to manage resources in XIDE
Posted: Mon Jul 10, 2017 4:14 am
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:
2) "Create new" - "New resource file"
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
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:
Code: Select all
oAssembly := Assembly.GetExecutingAssembly()
oBitmap := Bitmap{ oAssembly:GetManifestResourceStream( "blue.png" ) }
2) "Create new" - "New resource file"
Code: Select all
oResourceManager := System.Resources.ResourceManager{ "bitmap", oAssembly }
oObject := oResourceManager:GetObject( "red.png" )
if oObject is Bitmap
oBitmap := ( Bitmap ) oResourceManager:GetObject( "red.png" )
endif
ResourcesSample.zip
Hope to help someone.
Wolfgang