这是我第一次在网上发布自写的程序,希望各位支持和批评!
LOGOBAR下载
引子&原理:
现在,Windows95、Windows98、WindowsMe以其优秀的兼容性和易操作性仍占据了许多用户的计算机。当我们启动计算机时,都会看到一段带有滚动色条的LOGO-“蓝天白云”,这已经成为了Windows9x的标志。许多文章都透露,“蓝天白云”其实是位于C盘根目录下的一个文件LOGO.SYS,这其实是一个320X400X256色的BMP文件,用简单的“画图”就可以制作出来。但BMP是静态的,WindowsLOGO是如何将它动起来的呢?这涉及到调色板方面的知识。
现在几乎所有的显卡都支持真彩色,但真彩色中的一个点需要至少24位的空间来存储,一个基本的640*480画面就需要640X480X3=921600字节,这对某些空间要求严格的程序来说太浪费了。因此几乎所有的显卡都支持调色板索引色方式,如VGA13H模式--此显示模式分辨率为320X200,可显示262144色(2^18),但因为使用了256项的调色板,所以同时只能显示262144色中的256色。虽牺牲了一部分色彩数,却使得每个点的占用空间缩小到了8位即一个字节,它记录着此色在调色板中的位置号,程序通过查表就可找到相应的RGB值并将之准确地显示出来。反过来说,我们甚至可以只修改调色板中记录的RGB值就可以使屏幕上部分点的色彩发生改变,而不用去重新绘点。微软的Windows9x系列在启动LOGO中就采用的方法与此类似:分辨率为320X400,同屏同时只显示256色,每个颜色对应调色板中的一种RGB色彩。当操作系统启动时,程序控制调色板最后的20项的颜色RGB分量按一定规则循环改变,屏幕上就使用了这20项色的点就出现了相应的动画效果--合理安排那些色点的位置就可以产生有趣的动画。现在有XrX Add Bar Utility,Animate Bar等工具可以在一个普通的BMP文件底部动画条效果,如果您更有创意的话,它们就不能胜任了--它们只能在图像的底部添加,源图像必须是320X400 256色的BMP文件--功能太少了。
这就是这个程序产生的原因。本程序可以做到更多您所想要的效果,不信您就试试看。不过,由于我写程序的机器太老(P75)只能运行DOS,此程序是用命令行参数来控制的。相信这不会难着你吧!
软件名:
LOGOBAR 易老师的LOGO.SYS动画条制作工具
版权说明:
本程序是自由软件,还有待改进。您可以使用它,可以复制给朋友,如果您觉得它给了您乐趣,希望Email给作者(
yihuawie@163.com)分享。如果您有任何商用目的,也请通知作者。
作者:
431700 湖北省天门市实验初级中学 易华卫
Email:
yihuawei@163.com
主页:
http://yisir.9126.com
版本:
V1.0 beta,2004年6月25日于湖北省天门市麻洋镇支教时编译。
用法:
LOGOBAR 源图像
源图像 是一个您已经设计好的图像文件,格式可以是BMP,PCX,LBM,TGA,BTW,
最好是Windows标准的BMP格式,图像的尺寸可以是320X400,色彩数
为256。也可是其他值,程序可以自动转换成320X400X256。
选项:
/TO=LOGO文件 将加了动画条的图像保存成LOGO文件,缺省值为LOGO.SYS。你可以使
用选项“/TO=C:\LOGO.SYS”来直接安装。
/PO=BOTTON|TOP|LEFT|RIGHT|MASKn 添加动画条的位置,缺省值为:BOTTON
BOTTON 在图像下方添加动画条,类似Windows9x自带方式
TOP 在图像上方添加动画条
LEFT 在图像左侧添加动画条
RIGHT 在图像右侧添加动画条
MASKn 在图像中指定为蒙板区域按指定规则绘制动画条(见“高级选项”)
/BC=n 动画条使用的色彩数,缺省值为20
/C1=色彩1 渐变色的起始色,以16进制表示RGB, 缺省值为 00FF00 (绿色)
/C2=色彩2 渐变色的结束色,以16进制表示RGB, 缺省值为 000000 (黑色)
/NP 不预览 /MT- 使用微软的另一种动画方式(不推荐)
高级选项:
/PO=MASKn 在图像中指定为蒙板区域按指定规则绘制动画条,约定图像的左上角
(0,0)像素点的颜色为蒙板色,图中所有以该色填充的区域构成蒙板区
域,在蒙板区域中根据n值有7种方式来绘制色条动画。
n=1 从左向右画竖色条,动画效果为色条向右运动
n=2 从上向下画横色条,动画效果为色条向下运动
n=3 从左上向右下画//形色条,动画效果为色条向右下运动
n=4 从右上向左下画\\形色条,动画效果为色条向左下运动
n=5 从中心向四周画辐射色,动画效果如风车顺时针转动
n=6 从中心向四周画同心椭圆,动画效果为椭圆由小变大
n=7 从中心向四周画同心矩形,动画效果为矩形由小变大
如果你在n前使用了“-”,那动画的运动方向将和上面相反。
示例:代表回车
LOGOBAR mylogo.bmp 在mylogo.bmp的底部加上色条,预览,并保存为LOGO.SYS
LOGOBAR mylogo.bmp /TO=C:\LOGO.SYS加色条后安装。
LOGOBAR cat.bmp /PO=MASK7, 在图cai.bmp中按蒙板区域做矩形渐大动画效果。
更多示例请运行DEMO.BAT
LOGOBAR下载
Last edited by TurboY on 2006-11-29 at 09:42 PM ]
This is my first time posting my self-written program online. I hope everyone will support and critique it!
Download LOGOBAR
Introduction & Principle:
Currently, Windows 95, Windows 98, and Windows Me still occupy many users' computers due to their excellent compatibility and ease of operation. When we start the computer, we will all see a LOGO with a scrolling color bar - "Blue Sky and White Clouds", which has become the symbol of Windows 9x. Many articles reveal that "Blue Sky and White Clouds" is actually a file LOGO.SYS located in the root directory of the C drive. This is actually a 320X400X256 color BMP file, which can be produced with simple "Paint". But BMP is static. How does Windows LOGO make it move? This involves knowledge of the color palette.
Almost all current graphics cards support true color, but a point in true color requires at least 24 bits of space to store. A basic 640*480 screen requires 640X480X3 = 921600 bytes, which is too wasteful for some programs with strict space requirements. Therefore, almost all graphics cards support the palette index color mode, such as the VGA13H mode - this display mode has a resolution of 320X200 and can display 262144 colors (2^18), but because it uses a 256-item palette, it can only display 256 colors among the 262144 colors at the same time. Although some color numbers are sacrificed, the space occupied by each point is reduced to 8 bits, that is, one byte, which records the position number of this color in the palette. The program can find the corresponding RGB value by looking up the table and display it accurately. Conversely, we can even change the RGB value recorded in the palette to change the color of some points on the screen without having to redraw the points. The Windows 9x series of Microsoft uses a similar method in the startup LOGO: the resolution is 320X400, and only 256 colors are displayed on the same screen at the same time, and each color corresponds to an RGB color in the palette. When the operating system starts, the program controls the RGB components of the last 20 items of the palette to change cyclically according to a certain rule, and the points using these 20 items of color on the screen have corresponding animation effects - arranging the positions of those color points reasonably can produce interesting animations. Now there are tools like XrX Add Bar Utility, Animate Bar that can add an animation bar effect at the bottom of an ordinary BMP file. If you have more creativity, they can't do it - they can only add at the bottom of the image, and the source image must be a 320X400 256-color BMP file - the function is too limited.
This is the reason for the production of this program. This program can do more effects you want. Just try it if you don't believe it. However, since the machine I used to write the program is too old (P75) and can only run DOS, this program is controlled by command line parameters. I believe this won't be difficult for you!
Software Name:
LOGOBAR Yi Laoshi's LOGO.SYS Animation Bar Making Tool
Copyright Notice:
This program is free software and still needs improvement. You can use it, and you can copy it to friends. If you think it brings you fun, please email the author (
yihuawie@163.com) to share. If you have any commercial purpose, please also notify the author.
Author:
431700 Yihuawei, Experimental Junior Middle School, Tianmen City, Hubei Province
Email:
yihuawei@163.com
Homepage:
http://yisir.9126.com
Version:
V1.0 beta, compiled on June 25, 2004 during teaching support in Maoyang Town, Tianmen City, Hubei Province.
Usage:
LOGOBAR Source Image
Source Image is an image file you have designed. The format can be BMP, PCX, LBM, TGA, BTW. It is best to be the Windows standard BMP format. The size of the image can be 320X400, and the number of colors is 256. It can also be other values, and the program can automatically convert it to 320X400X256.
Options:
/TO=LOGO File Save the image with the animation bar as a LOGO file. The default value is LOGO.SYS. You can use the option "/TO=C:\LOGO.SYS" to install directly.
/PO=BOTTON|TOP|LEFT|RIGHT|MASKn Position to add the animation bar. The default value is: BOTTON
BOTTON Add the animation bar at the bottom of the image, similar to the way Windows 9x comes with
TOP Add the animation bar at the top of the image
LEFT Add the animation bar at the left side of the image
RIGHT Add the animation bar at the right side of the image
MASKn Draw the animation bar in the specified mask area in the image according to the specified rule (see "Advanced Options")
/BC=n Number of colors used in the animation bar. The default value is 20
/C1=Color 1 Start color of the gradient color, represented in hexadecimal as RGB. The default value is 00FF00 (green)
/C2=Color 2 End color of the gradient color, represented in hexadecimal as RGB. The default value is 000000 (black)
/NP No preview /MT- Use another animation method of Microsoft (not recommended)
Advanced Options:
/PO=MASKn Draw the animation bar in the specified mask area in the image. It is agreed that the color of the pixel at the top-left corner (0,0) of the image is the mask color. All areas filled with this color in the image form the mask area. In the mask area, there are 7 ways to draw the color bar animation according to the value of n.
n=1 Draw vertical color bars from left to right, and the animation effect is that the color bars move to the right
n=2 Draw horizontal color bars from top to bottom, and the animation effect is that the color bars move down
n=3 Draw //-shaped color bars from top-left to bottom-right, and the animation effect is that the color bars move to the bottom-right
n=4 Draw \\-shaped color bars from top-right to bottom-left, and the animation effect is that the color bars move to the bottom-left
n=5 Draw radiation colors from the center to the surroundings, and the animation effect is like a windmill rotating clockwise
n=6 Draw concentric ellipses from the center to the surroundings, and the animation effect is that the ellipses become larger from small
n=7 Draw concentric rectangles from the center to the surroundings, and the animation effect is that the rectangles become larger from small
If you use "-" before n, the movement direction of the animation will be opposite to the above.
Example: represents carriage return
LOGOBAR mylogo.bmp Add color bars at the bottom of mylogo.bmp, preview, and save as LOGO.SYS
LOGOBAR mylogo.bmp /TO=C:\LOGO.SYS Install after adding color bars.
LOGOBAR cat.bmp /PO=MASK7, Make a rectangular gradual enlargement animation effect in the mask area in the figure cai.bmp.
For more examples, run DEMO.BAT
Download LOGOBAR
Last edited by TurboY on 2006-11-29 at 09:42 PM ]