zhuantou215 Posted April 20, 2018 Report Posted April 20, 2018 Thank for your help.If I want to use custom pictures, how to convert pictures into code? Are there any special tools?
Joel Bodenmann Posted April 20, 2018 Report Posted April 20, 2018 There's no generalized way as you can load an image from almost any source. µGFX doesn't care how you get your image into memory. All it requires is to have byte level access to the image in order to decode it. But whether you manually wrote it into some external FLASH or whether you loaded it from an SD-Card through FatFS doesn't matter. If you want to store images in your microcontroller's FLASH you can use ROMFS which is a file system that we wrote ourselves that allows loading images from the microcontroller's FLASH directly through the GFILE API as shown in many examples. The nice thing about ROMFS is that it comes with a tool named file2c that allows you to "convert" the image. All it does is taking any kind of data as input, interpreting it as binary data and creating one or more C arrays out of it including some file & directory information for easy handling during runtime and even easier handling during flashing as you can just #include the image data - no need to dick around with linker scripts or things like that.
zhuantou215 Posted April 20, 2018 Author Report Posted April 20, 2018 Thank you very much for your help. I can only pull the path of the picture into file2c.exe.But I can't use it. I hope you can tell me how to use it.
Joel Bodenmann Posted April 20, 2018 Report Posted April 20, 2018 The wiki and the examples show you how to use it. If you have a particular problem we need to know what issue you're facing.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now