Friday 8 January 2016

Animated Britney Spears bitmaps for E2B


This example shows how to display a sequence of 26 bitmaps on E2B start-up.




I found an animated GIF and then decomposed it using a web application at http://en.bloggif.com/gif-extract. Then I converted each GIF into a .bmp file.

IrfanView can also convert an animated GIF directly into individual bitmap files using the Options - Extract all Frames tab.

I then compressed all the .bmp files using the E2B LZMA compressor at \_ISO\docs\E2B Utilities\LZMA (I just drag-and-dropped all the .bmp files onto the LZMA_ENCODE.cmd file).
This compressed each 390K bitmap to just 22K.

Now I had 26 LZMA compressed bitmaps from frame-01.bmp to frame-26.bmp in the \_ISO\docs\BritneyLZMA folder on my E2B USB drive.

The following code can then be added to the \_ISO\MyE2B.cfg file. It does not load each .bmp file into memory first however, and so we do get some black screen flashes in between each picture. I am hoping chenall or someone can suggest a way to be able to display a sequence of bitmaps without having to use the 'clear' command to make each one display after each splashimage command...

!BAT

# only run on first boot
if exist DONEMENU goto :Blpe

# You can find an animated GIF and then decompose it to separate GIFs using a web page converter - then re-save as .bmp files
# Tip: compress .bmp files using LZMA utility to make them smaller and load faster - see \_ISO\docs\E2B Utils\LZMA folder

graphicsmode -1 800 600 > nul
call Fn.70 3 > nul
errorcheck on
clear


# one delay unit = approx 65 milliseconds
set delay=0x05
# path of files including name up to the start of the number - e.g. frame-01.bmp, frame-02.bmp... frame-26.bmp, etc.
set P=/_ISO/docs/BritneyLZMA/frame-
# Load 800x600 white background (only needed if bmp frames are smaller than 800x600)
# if frames have different colour background then use a matching 800x600 blank bmp
splashimage /_ISO/docs/BritneyLZMA/whitebackgnd.bmp > nul
# set last frame number
set MAX=26


set key=
set C=1

# don't abort if missing image
errorcheck off

:Blp
if %C%<=9 set D=0%C% > nul || set D=%C% > nul
splashimage %P%%%D%.bmp > nul
clear
call Fn.5 0 50 > nul
/_ISO/e2b/grub/bios int=0x15 eax=0x8600 ecx=%delay% edx=0x0000 > nul
set /a C=%C%+1 > nul
if %C%<=%MAX% goto :Blp

# normal mode
call Fn.70 2 > nul
# clear screen bitmap - can use different bitmap if you wish before E2B background is used
splashimage > nul
clear

# clear variables
set key=
set MAX=
set C=
set D=
set P=
:Blpe

The bitmaps and the MyE2B.cfg file can be downloaded from the Themes folder here.
An improved version 2 which loads the bitmap into memory first is here.

Something with a black background would have been better so that the blank screen in between each frame would be less noticeable! Also, using 800x600 bitmaps might stop the graphics resolution from changing so much which causes the monitor to lose sync for a while (an HDMI monitor takes several seconds!),

No comments:

Post a Comment