chenall / grub4dos

外部命令和工具源码:https://github.com/chenall/grubutils 下载:
http://grub4dos.chenall.net
GNU General Public License v2.0
643 stars 136 forks source link

Request: display animated picture #90

Closed steve6375 closed 8 years ago

steve6375 commented 8 years ago

I would like to display a sequence of animated pictures or show a small cartoon using grub4dos. I have managed to do this by using splashimage and clear - see http://rmprepusb.blogspot.co.uk/2016/01/display-animated-picture-in-grub4dos.html However, the 'clear' takes too long and there is always a black screen in between the pictures. Is there a way to display bitmaps in rapid succession in grub4dos? It would also be nice to be able to specify an x,y location for splashimage so that smaller bitmaps (e.g. 200x200) could be overlaid onto a larger 800x600 bitmap so that only a small area is updated with an animated graphic after loading a larger wallpaper bitmap. It would also be nice to be able to display animated .gifs too (perhaps using a grub4dos utility?). Any ideas welcome!

steve6375 commented 8 years ago

Is there a way to display a sequence of bmp files please without having to use the clear command?

https://onedrive.live.com/redir?resid=8A0F146CC7416BA9!2179&authkey=!AKDgDMlcRRP1Gxg&ithint=file%2czip

yaya2007 commented 8 years ago

May be used to achieve. Can you provide 'sequence of bmp files' in order to develop the test? The above link cannot be opened in the mainland.

steve6375 commented 8 years ago

Animated_BritneyLZMA_v2.zip

yaya2007 commented 8 years ago

Very interesting! It seems that the menu appears, can not reproduce the animation.

steve6375 commented 8 years ago

It needs to be called as a batch file please try new version Animated_Britney_Test.zip

yaya2007 commented 8 years ago

Very good! Can display animation in menu items.

In the menu item background picture, displays the small, simple animation, very interesting. I wonder if it is necessary.

steve6375 commented 8 years ago

The test code has two problems though

  1. The screen is blanked/cleared after each picture is displayed
  2. The graphicsmode is changed after each picture is displayed which causes the monitor to lose sync, on an HDMI monitor, the monitor takes several seconds to re-sync between each picture

What I would like to know is how I can prevent these two problems so that I can display a sequence of bitmaps.

yaya2007 commented 8 years ago

"which causes the monitor to lose sync, on an HDMI monitor, the monitor takes several seconds to re-sync between each picture" Do not understand

steve6375 commented 8 years ago

Did you try it on a PC with a hdmi monitor? I mean real system, not a VM. Splashimage seems to change graphicsmode twice and this causes the monitor to lose sync for about 2 seconds!

steve6375 commented 8 years ago

Thanks for the new splashimage support. I tried splashimage --offset=300=300 using a smaller 203x281pixel icon bmp file. graphicsmode -1 800 600 splashimage /My800x600.bmp splashimage --offset=300=300 /icon.bmp

The small image is stretched/distorted. Am I doing something wrong? image

yaya2007 commented 8 years ago

I have no problem here.Upload icon.bmp.

steve6375 commented 8 years ago

It seems to depend on what is in the bmp ??? image

G.zip

steve6375 commented 8 years ago

P.S. if --offset is used, then any following splashimage uses that offset e.g. splashimage --offset=200=200 /icon.bmp splashimage /picture800x600.bmp

The second bitmap is displayed at 200 200 - should be at 0 0

yaya2007 commented 8 years ago

iconBAD.bmp and iconOK.bmp OK!

steve6375 commented 8 years ago

/menu.lst

graphicsmode -1 800
splashimage --offset=300=300 /iconok.bmp
splashimage --offset=100=100 /iconbad.bmp

title TEST
reboot

image

steve6375 commented 8 years ago

Same menu booted from EeePC instead of VBox image

steve6375 commented 8 years ago

I use grldr from download zip file - is it same version as you?

steve6375 commented 8 years ago

P.S. Is there a splashimage command to fill the graphics memory with a single colour? Might be useful? e.g. splashimage --fillcolor=0xrrggbb --offset=100=200 /icon.bmp

yaya2007 commented 8 years ago

First, loading a whole background image is normal.

yaya2007 commented 8 years ago

"The small image is stretched/distorted" This is how to return a responsibility?

steve6375 commented 8 years ago

Sorry - I don't understand??

steve6375 commented 8 years ago

Yes, but with new offset parameter, we can now just have a small logo and fill graphics memory with a single colour. This means faster menu (no large .bmp file to load). Presumably the graphicsmode command does not fill memory with 00's = black?

yaya2007 commented 8 years ago

"Presumably the graphicsmode command does not fill memory with 00's = black?" yes

2012yaya2007 commented 8 years ago

http://bbs.wuyou.net/forum.php?mod=viewthread&tid=369720&extra=page%3D1

steve6375 commented 8 years ago

Thanks for the new features! :+1:

I think Help text is wrong

Type [type]: bit0-3: 0/1/2 = empty / time / cycle

This is incorrect! Should be...???

Type [type]: bit0-3: 0/1/2 = cancel / cycle / time

0 = uninstall 1 = cycle 2 = time

Also, I have a problem with cycle with Easy2Boot. If I load a bitmap splashimage and use cycle, then the animated picture does not appear on menu, but, if I press Down Arrow key or Up Arrow Key then the the picture appears. Each time I press Up/Down the next picture in sequence appears. This problem is caused by loading hotkey grub4dos utility. So hotkey stops animation.

steve6375 commented 8 years ago

splashimage with cycle displays Loading Splashimage.... image

unless debug 0 is used. Can message be suppressed for animated command please?

# must unload hotkey as stops animation in cycle mode
hotkey -u
set trans=0x10 && set once=0x2 && set cycle=0x1
set /A type=%cycle% + %trans%
set delay=0x1
set end=0x1a
set offx=20
set offy=90
set P=/BritneyLZMA/frame-01.bmp
#debug 0
splashimage --animated=%type%=%delay%=%end%=%offx%=%offy%=%P% > nul
clear
title TEST1
root ()
2012yaya2007 commented 8 years ago

I think carefully, or the use of "debug=0" as a good.

steve6375 commented 8 years ago
splashimage /wallpaper.bmp
splashimage --animated=1=xxxxxxx

this works, but

splashimage --animated=1=xxxxxxx
splashimage /wallpaper.bmp

does not work. The cycle animation does not start if followed by a normal splashimage command.

where xxxx is a valid command string of parameters.

2012yaya2007 commented 8 years ago

bit0-3: 0/1/2=invalid/single/repeat bit4-7: 0/1=normal/keyer how?

2012yaya2007 commented 8 years ago

Please follow the "splashimage --animated=[type]=[delay]=[sequence_num]=[offset_x]=[offset_y]=[name]",Don't lean. 1.Parameter has no default value. 2.Type has been retained.

steve6375 commented 8 years ago

type 0=disable (clears previous animation) 1=repeat 2=once +0x10=transparent

This is what I have found when testing. It does not match documentation.

steve6375 commented 8 years ago

It would be nice to repeat the animation more than once. Is it possible to specify number of loops for 'once' maybe change type definition?

bits 0-3= number cycles 1-15 (if 0 then disable previous animation) bit 4 = transparent bit 5 = infinite cycle

e.g. 0x31 = cycle always transparent, 0x06 = show 6 times, 0x00 = disable previous cycle animation

or maybe: bits 0-3 = number cycles 1-15 (if 0 = infinite) bit 4 = transparent bit 5 = disable previous infinite cycle

??

2012yaya2007 commented 8 years ago

type: bit0-3: 0/1/2=disable/repeat/once bit4-7: 0/1=disable/transparent_background

steve6375 commented 8 years ago

How can I cycle 3 times? If I repeat splashimage --animated then it is not smooth. I would like to show user animation for n cycles.

2012yaya2007 commented 8 years ago

type: bit0-2: cycle times(1-7times) bit3:transparent_background bit4-7: 1/2=repeat/cycle 00=disable

steve6375 commented 8 years ago

bit0-2: cycle 1-7 times bit 3: transparent bit 4: infinite cycle type=0: disable

or maybe bit0-3: cycle 1-15 times bit 4: transparent bit 5: infinite cycle

?? easier to work in hex +0x10 +0x20 is easier for user ??

P.S. For splashimage --offset=730=40 /_ISO/E2B.bmp a transparent_background option might be useful? splashimage --toffset=730=40 /_ISO/E2B.bmp ???

2012yaya2007 commented 8 years ago

bit0-3: cycle 1-15 times bit 4: transparent bit 5: infinite cycle type=0: disable ok

splashimage --toffset=730=40 /_ISO/E2B.bmp Can not

steve6375 commented 8 years ago

splashimage --animated=0x11=1=1=750=540=/_ISO/E2B01.bmp this works if just use 1 for number of bitmaps. = transparent

steve6375 commented 8 years ago

_Maybe use rule if number=1 then use exact filename splashimage --animated=0x11=1=1=750=540=/_ISO/E2B.bmp - displays E2B.bmp transparent splashimage --animated=0x01=1=1=350=540=/_ISO/E2B05.bmp - displays E2B05.bmp

then no need for splashimage --offset command?_

steve6375 commented 8 years ago

Actually --animated for 1 picture does not work correctly if hotkey, so please keep --offset command!

2012yaya2007 commented 8 years ago

If you do not enter the offset, that is, the previous use of.

2012yaya2007 commented 8 years ago

1 transparent +1 opaque+1 transparent +1 opaque.... Need to be so complicated?

steve6375 commented 8 years ago

Sorry, I don't understand you??? bit0-3: cycle 1-15 times bit 4: transparent bit 5: infinite cycle type=0x00: disable is OK for me.

2012yaya2007 commented 8 years ago

"type: bit 0-3:times bit 4:play bit 5:repeat forever\n" " bit 7:transparent background type=00:disable\n"

paly n times: Animation and menu key sharing time repeat forever: Animation exclusive time

steve6375 commented 8 years ago

Good :+1:

steve6375 commented 8 years ago

I think small bug in cycle code If display animation of 9 images 01 to 09, then last frame09.bmp has no delay so user cannot see it unless it is left on screen. e.g. splashimage --animated=2=15=09=350=250=/frame01.bmp splashimage /wallpaper.bmp

Then user does not see frame09.bmp because there is no delay after it is displayed. Code should be

  1. display frame
  2. delay
  3. loop or exit
steve6375 commented 8 years ago

Also, if file not found then abort loop.

steve6375 commented 8 years ago

For transparent, if background is black (first pixel is rgb 0x000000) then transparent does not work. Does first pixel need to be non-zero? How does transparent decide on background colour?

steve6375 commented 8 years ago

re. splashimage help name must be xxxxx01.xxx (not xxxx-01.xxx) 'sequence_num' maybe better described as 'last_num' ??

2012yaya2007 commented 8 years ago

Please test http://bbs.wuyou.net/forum.php?mod=viewthread&tid=369720&extra=&page=1