[Mono-list] Embedding resources (bug?)
Mariano Alarcon
marianoa@itcsoluciones.com
Tue, 14 Sep 2004 17:09:07 -0400
Thanks. This raises two questions, though:
1- Does de gtk# library(ies) run without the rest of the mono runtime
(i.e. inside de .net framework) ?
2- How do you create a .resources file that can be deserialized into a
gtk# Image type (if there is such a thing)?
Does anyone know?
> AFAIK, the system.drawing namespaces aren't complete under mono, and
> not sure where this is going... afaik, you should be using gtk# to do
> image manipulation under mono... again, not 100% on this.. worth a look.
>
> Mariano Alarcon wrote:
>
>> I found a strange behavior with this code:
>>
>> using System;
>> using System.Drawing;
>> using System.Resources;
>> using System.Reflection;
>>
>> namespace ResourceTests
>> {
>> /// <summary>
>> /// Gives an exception when trying to access
>> /// an embedded resource.
>> /// </summary>
>> class ResourceExceptionTest
>> {
>> static void Main(string[] args)
>> {
>> ResourceManager rm = new ResourceManager("Imagenes",
>> Assembly.GetExecutingAssembly());
>>
>> Image img = (Image) rm.GetObject("imagen");
>> img.Save("test.gif", System.Drawing.Imaging.ImageFormat.Gif);
>>
>> Console.WriteLine("The image was successfully saved!");
>> }
>> }
>> }
>>
>> I created a "Imagenes.resources" file using an utility called
>> "Resourcer" from Lutz Roeder which can be downloaded from here:
>> (http://www.aisto.com/roeder/dotnet/). But I don't think that's the
>> problem.
>>
>> Here is what happens:
>>
>> - runs on windows with ms.net 1.1
>> - compiles on linux (mono 1.0) and runs fine (mono's binary) on
>> windows with ms.net 1.1
>> - on linux running mono 1.0 it explodes with:
>
>
--
Mariano Alarcón