刚工作的时候写的,呵呵,就是存档而已,先留着,以后说不定要回顾一下呢
static U8* rotate_ptr =NULL;
void mmi_save_resized_layer(void)
{
PU8 img_end_ptr;
U8 byte_per_pixel;
U16 n,m;
PU8 img_src_ptr;
U32 i=0;
rotate_ptr= (U8*) mmi_frm_scrmem_alloc(((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3));
memset(rotate_ptr, 0x00, ((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3));
gdi_layer_get_buffer_ptr(&img_src_ptr);
img_end_ptr=img_src_ptr+((GDI_LCD_WIDTH*GDI_LCD_HEIGHT*GDI_MAINLCD_BIT_PER_PIXEL)>>3);//-2;
byte_per_pixel=GDI_MAINLCD_BIT_PER_PIXEL>>3;
for(n=0;n<320;n++)
{
for(m=0;m<240;m++)
{
// rotate_ptr[i]=*(img_end_ptr-((m+1)*320+n-1-m-240)*byte_per_pixel);
rotate_ptr[i]=*(img_end_ptr-((m+1)*320-n)*byte_per_pixel);
i++;
// rotate_ptr[i]=*(img_end_ptr-((m+1)*320+n-1-m-240)*byte_per_pixel+1);
rotate_ptr[i]=*(img_end_ptr-((m+1)*320-n)*byte_per_pixel+1);
i++;
}
}
gdi_image_bmp_encode_file(240,320,byte_per_pixel,rotate_ptr,(PS8)PHNSET_DEFAULT_TEMP_WALLPAPER_PATH_SHOW);
mmi_frm_scrmem_free(rotate_ptr);
rotate_ptr=NULL;
}