From 04ac84d0e2eca3da4d74b52b5f5dffba00609bd2 Mon Sep 17 00:00:00 2001 From: Liu Chao Date: Fri, 21 Jun 2013 10:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=94=E7=94=A8LCUI=5FGraph=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E4=BD=93=E6=88=90=E5=91=98=E7=9A=84=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bmp/jpeg.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bmp/jpeg.c b/src/bmp/jpeg.c index 1bcf7fbb..14ab9f91 100755 --- a/src/bmp/jpeg.c +++ b/src/bmp/jpeg.c @@ -71,7 +71,7 @@ LCUI_API int Graph_LoadJPEG( const char *filepath, LCUI_Graph *out ) jaka = cinfo.num_components; //if (jaka==3) printf("color\n"); else printf("grayscale\n"); - out->have_alpha = FALSE; /* 设置为无透明度 */ + out->color_type = COLOR_TYPE_RGB; n = Graph_Create(out, cinfo.output_width, cinfo.output_height); if( n != 0 ){ printf("%s (): error: %s",__FUNCTION__, MALLOC_ERROR); @@ -84,9 +84,9 @@ LCUI_API int Graph_LoadJPEG( const char *filepath, LCUI_Graph *out ) for(y=0; cinfo.output_scanline width; + m = y*out->w; if ( jaka == 3 ) { - for (x=0;xwidth;x++) { + for (x=0;xw;x++) { n = x+m; k=x*3; out->rgba[0][n]=buffer[0][k++]; @@ -94,7 +94,7 @@ LCUI_API int Graph_LoadJPEG( const char *filepath, LCUI_Graph *out ) out->rgba[2][n]=buffer[0][k++]; } } else { - for (x=0;xwidth;x++) { + for (x=0;xw;x++) { n = x+m; out->rgba[0][n]=buffer[0][x]; out->rgba[1][n]=buffer[0][x]; @@ -102,7 +102,6 @@ LCUI_API int Graph_LoadJPEG( const char *filepath, LCUI_Graph *out ) } } } - out->type = TYPE_JPG;//图片类型为jpg (void) jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); fclose(fp);