Customizing the SDK Splash Screen
2015-03-05 09:09
99 查看
Overview
This article discusses how to customize the splash screen for the Linux SDK. The info was derived from thise2e forum post.
Steps
The "psplash" user space application is called at boot time, showing the TI logo splash screen. In order to change the displayed image, you need to first download the "psplash" package source code from here.The next steps are as follows:
1. Use the ./make-image-header.sh script included in the package to create a new header file with your new image: (you need to install libgdk-pixbuf2.0-dev library first)
./make-image-header.sh <path_to_image_file> <NAME>
Note: The <NAME> argument can be whatever you want it to be, but for the fastest approach you should use "POKY" as this is what is used by default in the psplash.c file. Unfortunately this isn't configurable and you have to edit the file manually if you wish
to use different name.
- The above command will generate the header file with the image contents (<your_logo_filename>-img.h). - Open the psplash.c file and replace the file name in the following line at the top of the file:
#include "psplash-poky-img.h"
with
#include "<your_logo_filename>-img.h"
2.Export the needed variables and then configure and build psplash:
export CROSS_COMPILE=arm-linux-gnueabihf- export ARCH=arm export PATH=$PATH:$HOME/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin ./autogen.sh --host=arm-linux CC=arm-linux-gnueabihf-gcc make
3. Replace the /usr/bin/psplash file in your root file system with the generated psplash file.
首先通常运行时总出现一条横贯左右的白条,经查,该函数作怪,
/* Clear */
/*psplash_fb_draw_rect (fb,
0,
fb->height - (fb->height/6) - h,
fb->width,
h,
0xec, 0xec, 0xe1);*/
删后该问题解决。
关于进度条,先删了一个进度条的外框函数,感觉没什么用,删后效果还好,该函数为:
/* Draw progress bar border */
/*psplash_fb_draw_image (fb,
(fb->width - BAR_IMG_WIDTH)/2,
fb->height - (fb->height/10),
BAR_IMG_WIDTH,
BAR_IMG_HEIGHT,
BAR_IMG_BYTES_PER_PIXEL,
BAR_IMG_RLE_PIXEL_DATA);*/
查看psplash.c里边有关于进度条的函数,
psplash_draw_progress (PSplashFB *fb, int value)
{
int x, y, width, height, barwidth;
/* 4 pix border */
x = ((fb->width - BAR_IMG_WIDTH)/2) + 4 ;
y = fb->height - (fb->height/6) + 4;
width = BAR_IMG_WIDTH - 8;
height = BAR_IMG_HEIGHT - 8;
if (value > 0)
{
barwidth = (CLAMP(value,0,100) * width) / 100;
psplash_fb_draw_rect (fb, x + barwidth, y,
width - barwidth, height,
0xec, 0xec, 0xe1);
psplash_fb_draw_rect (fb, x, y, barwidth,
height, 0x6d, 0x6d, 0x70);
}
else
{
barwidth = (CLAMP(-value,0,100) * width) / 100;
psplash_fb_draw_rect (fb, x, y,
width - barwidth, height,
0xec, 0xec, 0xe1);
psplash_fb_draw_rect (fb, x + width - barwidth,
y, barwidth, height,
0x6d, 0x6d, 0x70);
}
DBG("value: %i, width: %i, barwidth :%i/n", value,
width, barwidth);
}
看了一下,也就是画方框,之后根据进度画着了色的进度框,改代码如下:
void
psplash_draw_progress (PSplashFB *fb, int value)
{
int x, y, width, height, barhight;
x = 100;
y = ((fb->height - BAR_IMG_WIDTH)/2) + 4;
width =BAR_IMG_HEIGHT - 16;//width = BAR_IMG_WIDTH - 8;
// height = BAR_IMG_HEIGHT - 8;
height = BAR_IMG_WIDTH - 8;//height = BAR_IMG_HEIGHT - 16;
if (value > 0)
{
//barwidth = (CLAMP(value,0,100) * width) / 100;
barhight = (CLAMP(value,0,100) * height ) / 100;
psplash_fb_draw_rect (fb, x , y+ barhight,//psplash_fb_draw_rect (fb, x + barwidth, y,
width , height- barhight,//width - barwidth, height,
0xec, 0xec, 0xe1);
psplash_fb_draw_rect (fb, x, y, width,
barhight, 0x6d, 0x6d, 0x70);
}
else
{
barhight = (CLAMP(-value,0,100) * height) / 100;
psplash_fb_draw_rect (fb, x, y,
width, height- barhight,
0xec, 0xec, 0xe1);
psplash_fb_draw_rect (fb, x,
y, width, barhight,
0x6d, 0x6d, 0x70);
}
DBG("value: %i, width: %i, barhight :%i/n", value,
width, barhight);
}
相关文章推荐
- Changing the Visual Studio Splash Screen Registered User
- Customizing the Unity Web Player loading screen
- Reads information from the file and outputs it onto the screen
- error when loading the sdk 发现了元素 d:skin 开头无效内容
- cordova SplashScreen插件在android上退出app后不再显示启动画面的问题
- Customizing the GNOME Shell
- How to replace the boot screen with one of your own
- 《Beginning iOS 6 Development Exploring the iOS SDK》学习之问题(七、八、九、十)
- Unknown error: Unable to build: the file dx.jar was not loaded from the SDK folder!
- Get the Android SDK翻译
- android 关于Location of the Android SDK has not been setup in the preferences的解决方法
- Universal Windows App Development with Cortana and the Speech SDK 1 and 2 @Channel9
- Take screenshots from the command line in Linux
- 解决Eclipse报错显示Unable to build: the file dx.jar was not loaded from the SDK folder
- 电子书下载:Beginning iPhone 4 Development: Exploring the iOS SDK
- Server-side ASP .NET Data Binding, Part 2: Customizing the DataGrid Control
- The Windows SDK team is proud to announce that the RTM release of the Microsoft Windows SDK for Windows Server 2008 and .NET Fra
- About Location of the android sdk has not been setup in the preferences
- The SDK platform-tools version (24.0.4) is too old to check APIs compiled with API 25
- Splash screen in USBloader