Reading files

HomeForumsMonoBrick EV3 FirmwareReading files

Tagged: , ,

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4430
    Author Image
    Simon Stochholm
    Participant

    How can I read image files (.rgf) that are embedded in my program, so that I can show them on the display?

    #4435
    Author Image
    Tcm0
    Participant

    I think that MonoBrick only can show *.bmp files yet: General Description and example.

    #4437
    Author Image
    Simon Stochholm
    Participant

    Yes, I have seen that example. But if I try to use my own bitmaps it won’t work. It seems something special has been done to the file. For instance, it is actually a .bin file which has gotten a logical name of .bitmap, and the file cannot be opened by any paint program, so what has been done to the file? Can anyone give an example of reading different image files preferably bitmaps og rgf?

    #4438
    Author Image
    Helmut Wunder
    Participant

    hopefully this will be implemented into one of the next releases (standard bmp, png, jpg)

    #4905
    Author Image
    Max Headroom
    Participant

    Hi guys.

    Have been struggling to get bitmap reading/display to work. I have gone through the LcdExample project line by line and I cannot get my own custom bitmap images to be read and displayed. I have even tried exporting my bitmaps as raw files and removing the bitmap header from existing bitmaps. I am trying to load a 1bit monochrome BMP to display as part of the UI on my project. I use Visual Studio as my IDE and I have compiled my bitmaps/bins into the exe using ‘Add Existing Item’ and setting resource property to ‘Embedded Resource’.

    – Anders would you mind posting details of how you created the monologo.bin file included with the example? What am I missing from the creation of my bitmaps?

    – Why do you include your bitmap data as a .bin? Would it not make sense to use .bmp?

    – I also tried using the .net System.Drawing.Bitmap class to load the bitmap and then pass it to your MonoBrick Bitmap class for display but this didn’t work either. Is there a way to do this?

    – Why does the Bitmap constructor take a uint array rather than a byte array?

    – Why does the ‘LcdExample.csproj’ file contain the following:

    52   <ItemGroup> 
    53     <Folder Include="Resources\" /> 
    54   </ItemGroup> 

    When I use VS to embed the resources (which are stored in the Resources\ folder), this line is not generated.

    Sorry for all the questions, but handling bitmaps is a major part of the planned UI for our current project and I’m at a complete loss.

    Thanks in advance.

    P.S. I would be happy to use non embedded bitmaps but I can’t load these either. Can’t see any way to load bitmaps without using ‘FromResource’.

    #4924
    Author Image
    Anders Søborg
    Keymaster

    Hi all

    Just a quick reply before I go to bed. this tool creates a binary file that you can embed as a resource in your program.

    /Anders

    #4927
    Author Image
    Max Headroom
    Participant

    Absolutely perfect. Solved all of my problems. Thank you very much indeed.

    Looking forward to getting more details when you get a chance!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Posted in

Make a donation