mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-11-27 12:05:34 +00:00
Updated Create a custom splash screen (markdown)
parent
d5985fc1ca
commit
004e434362
@ -5,7 +5,7 @@ You can!
|
|||||||
Prerequisites:
|
Prerequisites:
|
||||||
Some form of linux command line such as WSL or a bash/sh prompt
|
Some form of linux command line such as WSL or a bash/sh prompt
|
||||||
A graphics program such as GIMP (Gnu Image Manipulation Program)
|
A graphics program such as GIMP (Gnu Image Manipulation Program)
|
||||||
xxd (available from your packet manager, in Debian-based systems sudo apt install xxd)
|
`xxd` (available from your packet manager, in Debian-based systems sudo apt install xxd)
|
||||||
|
|
||||||
Create (or load) an image
|
Create (or load) an image
|
||||||
|
|
||||||
@ -22,17 +22,17 @@ Save it as splash.bmp to a directory such as ~/Pictures
|
|||||||
Open a terminal window
|
Open a terminal window
|
||||||
|
|
||||||
Change directory to where the image was saved (for example ~/Pictures):
|
Change directory to where the image was saved (for example ~/Pictures):
|
||||||
cd ~/Pictures
|
`cd ~/Pictures`
|
||||||
Convert the image to a c++ header file:
|
Convert the image to a c++ header file:
|
||||||
xxd -i splash.bmp bmp_splash.hpp
|
`xxd -i splash.bmp bmp_splash.hpp`
|
||||||
|
|
||||||
Make a backup of the existing splash screen
|
Make a backup of the existing splash screen
|
||||||
Change directory to the path to where you downloaded the Mayhem source eg ~/src/portapack_mayhem
|
Change directory to the path to where you downloaded the Mayhem source eg ~/src/portapack_mayhem
|
||||||
cd ~/src/portapack_mayhem
|
`cd ~/src/portapack_mayhem`
|
||||||
mv firmware/application/bitmaps/bmp_splash.hpp firmware/application/bitmaps/bmp_splash.hpp.backup
|
`mv firmware/application/bitmaps/bmp_splash.hpp firmware/application/bitmaps/bmp_splash.hpp.backup`
|
||||||
|
|
||||||
Copy the new splash screen to here
|
Copy the new splash screen to here
|
||||||
cp ~/Pictures/bmp_splash.hpp firmware/application/bitmaps/bmp_splash.hpp
|
`cp ~/Pictures/bmp_splash.hpp firmware/application/bitmaps/bmp_splash.hpp`
|
||||||
|
|
||||||
Finally, rebuild the source and flash the HackRF One and PortaPack.
|
Finally, rebuild the source and flash the HackRF One and PortaPack.
|
||||||
|
|
||||||
@ -42,11 +42,11 @@ Someone asked whether it would be possible to just load a .PNG or .JPG image int
|
|||||||
A quick solution to this would be to use the [ImageMagick](https://imagemagick.org/script/download.php) `convert` function which would take an image, resize it to fit the screen and change the filetype to a 4 bit RLE .BMP image in one step, meaning you just create a suitable image, save it as a .JPG or .PNG (or whatever type you prefer).
|
A quick solution to this would be to use the [ImageMagick](https://imagemagick.org/script/download.php) `convert` function which would take an image, resize it to fit the screen and change the filetype to a 4 bit RLE .BMP image in one step, meaning you just create a suitable image, save it as a .JPG or .PNG (or whatever type you prefer).
|
||||||
|
|
||||||
If the file is already the correct resolution:
|
If the file is already the correct resolution:
|
||||||
`convert filename.jpg -type Palette -compress RLE -colors 16 BMP3:splash.bmp
|
`convert filename.jpg -type Palette -compress RLE -colors 16 BMP3:splash.bmp`
|
||||||
xxd -i splash.bmp bmp_splash.hpp`
|
`xxd -i splash.bmp bmp_splash.hpp`
|
||||||
|
|
||||||
If the file needs resizing to fit:
|
If the file needs resizing to fit:
|
||||||
`convert -resize 240x304 filename.jpg -type Palette -compress RLE -colors 16 BMP3:splash.bmp
|
`convert -resize 240x304 filename.jpg -type Palette -compress RLE -colors 16 BMP3:splash.bmp`
|
||||||
xxd -i splash.bmp bmp_splash.hpp`
|
`xxd -i splash.bmp bmp_splash.hpp`
|
||||||
|
|
||||||
Note that the `-resize 240x304` part of the line will not necessarily resize the new image to exactly 240x304px, it will keep the aspect ratio so that one of the sides will be correct and the other one will scale properly.
|
Note that the `-resize 240x304` part of the line will not necessarily resize the new image to exactly 240x304px, it will keep the aspect ratio so that one of the sides will be correct and the other one will scale properly.
|
||||||
|
Loading…
Reference in New Issue
Block a user