Help with C Sharp

Discussion in 'Questions (Windows Mobile)' started by eww245, Jun 29, 2009.

  1. eww245

    eww245 Member Licensed User

    I have written a Library to expose the IImagingFactory interface.

    This works very well to load an image from a file, but I would rather use an imagelist.

    Does a basic4ppc imagelist act as an embedded resource that could be loaded in the below example?

    The MemoryStream would be loaded into a byte array and out to an IImage interface.

    MemoryStream strm = (MemoryStream)Assembly.GetExecutingAssembly().GetManifestResourceStream("Alpha.image.png");
  2. agraham

    agraham Expert Licensed User

    That will only work for an optimised compiled application. I think the resource names are prefixed with "b4p", you will have to check with GetManifestResourceNames().

    Isn't IImagingFactory a barely documented CE only COM interface? Bringing that into a .NET library looks deeply complicated to me :sign0188: I found this comment on the web about IImageFactory and IImage.
  3. eww245

    eww245 Member Licensed User

    There is not much documentation, what I found were examples in C and some C#
    It is the only way i've gotten true transparency with b4p.

    It looks like the resources are b4p.image.png but I am not very familiar with Reflection to get that info.
    I've tried with GetManifestResourceNames().GetType().GetField("b4p").GetValue(image)
    and many other combinations but always get null reference.

    I think all that's needed is an image converted to byte[] then pass that with it's length.
    Either through dzImage, the binary library or in this library.
    Do you think any of these will work?

    Both IImageFactory and IImage are from imaging.h in WM5 SDK

    After the image is created it's drawn with IImage.Draw to a rectangle then to the form.

    Here's the method i'm trying to use.

    Any help is much appreciated.

    CreateImageFromBuffer([MarshalAs(UnmanagedType.LPArray)] byte[] buffer, uint size, BufferDisposalFlag disposalFlag, out IImage image);
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice