Home→Forums→MonoBrick EV3 Firmware→Reading files
- This topic has 6 replies, 5 voices, and was last updated 10 years, 1 month ago by Max Headroom.
-
AuthorPosts
-
June 19, 2014 at 09:11 #4430
Simon StochholmParticipantHow can I read image files (.rgf) that are embedded in my program, so that I can show them on the display?
June 19, 2014 at 16:58 #4435
Tcm0ParticipantI think that MonoBrick only can show *.bmp files yet: General Description and example.
June 19, 2014 at 21:46 #4437
Simon StochholmParticipantYes, 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?
June 19, 2014 at 22:23 #4438
Helmut WunderParticipanthopefully this will be implemented into one of the next releases (standard bmp, png, jpg)
October 19, 2014 at 12:38 #4905
Max HeadroomParticipantHi 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’.
October 21, 2014 at 22:24 #4924
Anders SøborgKeymasterHi 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
October 23, 2014 at 18:18 #4927
Max HeadroomParticipantAbsolutely perfect. Solved all of my problems. Thank you very much indeed.
Looking forward to getting more details when you get a chance!
-
AuthorPosts
You must be logged in to reply to this topic.
Follow