| View previous topic :: View next topic |
| Author |
Message |
picobsd
Joined: 19 Apr 2007 Posts: 18
|
Posted: Tue Jul 31, 2007 1:25 am Post subject: How to display a PNG image with libpng |
|
|
hi all
my goal is to display the opaque part of a PNG image, and skip the transparent part of it(like acdsee )
I use libpng, use Double Frame Buffer and set display mode to PSP_DISPLAY_PIXEL_FORMAT_8888
the follow is my code fragment:
for (y = 0; y < info_ptr->height; y ++)
{
png_byte *prow = prowtable[y];
for (x = 0; x < info_ptr->width; x ++)
{
b = *prow++;
g = *prow++;
r = *prow++;
a = * prow++; // It' doesnt' work
iRetCode = __rgbaToColorAuto( lpImgData,r,g,b, a);//copy to image buffer
lpImgData+=__global_iPGPixelSize;
}
}
but it does'nt work, I think the fourth byte of png pixel is not as same as psp's alpha channel, Could you please tell me How should I disp a png image correctly? |
|
| Back to top |
|
 |
picobsd
Joined: 19 Apr 2007 Posts: 18
|
Posted: Tue Jul 31, 2007 12:47 pm Post subject: |
|
|
| I don't know why the alpha channel doesn't work when I put the color value which include rgba into Vram directly. |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
|
| Back to top |
|
 |
|