Like Windows XP, Windows CE can still draw a wonderful progress bar. In fact, this operation mainly involves operations on the screen cache. The buffer address image_framebuffer_ua_base_eboot has been provided in the S3C2440 cpu bsp code. The supported video encoding format of this buffer is rgb16, and the default color is white. In this process, unlike EVC, which provides many GDI plotting functions, such as drawing lines and rectangles, all operations start from a vertex, are made of a dot plot into a line, and drawn from a line into a rectangle. It can be found that the entire buffer can be defined as a binary data, each element is a vertex, and each row is a line. The access process is as follows;
- * (Embedsky_ LCD _buffer + y * LCD _xsize_tft + x) = 0xf800;
With the dot, we can plot it into a line, the following function;
Uint32 currwidth = 0;
Void drawprocessbar (uint32 total, uint32 current)
{
Uint32 const bar_height = 8;
Uint32 bar_base = LCD _ysize_tft-bar_height;
Int I = (INT) LCD _xsize_tft/8;
Uint32 J;
Int pbcolor = 0xf800; // red
Int bar_width;
// Printk ("tooal = % d, current = % d/N", total, current );
If (total! =-1)
{
J = 0;
Bar_width = (INT) LCD _xsize_tft * (current * 1.0)/Total );
If (bar_width> currwidth)
{
For (; j <bar_height; j ++)
{
Putpixel (bar_width, J + bar_base, pbcolor );
}
Currwidth = bar_width;
}
}
During the Windows CE startup process, You need to draw a scroll bar. Generally, you can place the above Code in the bootloadermain function, and the results have been verified to be good.