MTKThis article describes how to create special effects.MTKFor more information about how to use the application.
In the process of WIN image programming or FLASH production, a hundred-page window is the simplest and most frequently-performing special effect, and it is easy to use it by understanding the Core algorithms.MTK.
- for(i=0;i
- {
- my_gdi_layer_bitblt(Transition_Effect_layer,i*(UI_device_width/frame_num),0,
- g_step_w,UI_device_height,bg_layer,i*(UI_device_width/frame_num),0);
- }
The variable frame_num is the number of blind pages, Transition_Effect_layer is the special effect layer, and bg_layer is the layer of the new window. the core function is the copy function at this layer. if you are interested in the code, functions, and usage of this function, please refer to another article about the Function copy at the layer.
ForMTKFor the platform, menus and screen effects have been greatly affected for a long time.
However, the design process and method are rarely mentioned for various reasons.
Here we will introduce another method different from the method contained in logs a few days ago, that is, merge layers. Its core implementation function is as follows.
- voidmy_gdi_layer_copy(gdi_layer_struct*dst_layer,intdst_x,intdst_y,intwidth,intheight,
- gdi_layer_struct*src_layer,intsrc_x,intsrc_y)
- {
- U16*dst_buf,*src_buf;
- inti;
- if(dst_x<0||dst_y<0||dst_x+width>dst_layer->width||dst_y+height>dst_layer->height)
- {
- if(dst_x<0)
- {
- width-=-dst_x;
- src_x+=-dst_x;
- dst_x=0;
- }
- if(dst_y<0)
- {
- height-=-dst_y;
- src_y+=-dst_y;
- dst_y=0;
- }
- if(dst_x+width>dst_layer->width)
- {
- width=dst_layer->width-dst_x;
- }
- if(dst_y+height>dst_layer->height)
- {
- height=dst_layer->height-dst_y;
- }
- }
- if(src_x<0||src_y<0||src_x+width>src_layer->width||src_y+height>src_layer->height)
- {
- if(src_x<0)
- {
- width-=-src_x;
- dst_x+=-src_x;
- src_x=0;
- }
- if(src_y<0)
- {
- height-=-src_y;
- dst_y+=-src_y;
- src_y=0;
- }
- if(src_x+width>src_layer->width)
- {
- width=src_layer->width-src_x;
- }
- if(src_y+height>src_layer->height)
- {
- height=src_layer->height-src_y;
- }
- }
- if(width<=0||height<=0)
- return;
- dst_buf=(U16*)dst_layer->buf_ptr+dst_y*dst_layer->width+dst_x;
- src_buf=(U16*)src_layer->buf_ptr+src_y*src_layer->width+src_x;
- for(i=0;i
- {
- memcpy(dst_buf,src_buf,width*2);
- dst_buf+=dst_layer->width;
- src_buf+=src_layer->width;
- }
- }
If you are interested, you can use this function to develop various changes.
This function, coupled with another method provided some time ago, can produce about 20 effects.
Summary: DetailsMTKThe content of the special effect production method is omnipotent.MTKLearning application content can help you.