WEB开发网
开发学院手机开发Symbian 开发 symbian bitmap 处理图片 png jpg jpeg bmp 阅读

symbian bitmap 处理图片 png jpg jpeg bmp

 2010-07-04 15:33:00 来源:WEB开发网   
核心提示:symbian bitmap 处理图片 png jpg jpeg bmpTSize decodeimagesize;TInt reductionFactor = 0; //解码因子if(aSize != NULL){if(iImageDecoder->FrameInfo().iFlags & TFrameInfo

symbian bitmap 处理图片 png jpg jpeg bmp

TSize decodeimagesize;

TInt reductionFactor = 0; //解码因子

if(aSize != NULL)

{

if(iImageDecoder->FrameInfo().iFlags & TFrameInfo::EFullyScaleable)//解码器支持任意缩放

{//基本都支持了

decodeimagesize = *aSize;

}

else //否则

{

//由目标尺寸确定缩放因子 0 1 2 3 对应 1 1/2 1/4 1/8

reductionFactor = iImageDecoder->ReductionFactor(

iImageDecoder->FrameInfo().iOverallSizeInPixels, *aSize );

//实际缩放因子

if(reductionFactor > 3) reductionFactor = 3;

……

User::LeaveIfError(iImageDecoder->ReducedSize(

iImageDecoder->FrameInfo().iOverallSizeInPixels,

reductionFactor, decodeimagesize ) );

}//else //

}//if(aSize != NULL)

else

{

decodeimagesize = iImageDecoder->FrameInfo().iOverallSizeInPixels;

}

CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();

bitmap->Create( decodeimagesize, iImageDecoder->FrameInfo().iFrameDisplayMode);

bitmap->LockHeap(ETrue);

TUint8* bitmapaddress = (TUint8*)bitmap->DataAddress();

bitmap->UnlockHeap(ETrue);

if(bitmapaddress == NULL)

{

switch(reductionFactor)

{

case 0:

{

delete bitmap;

bitmap = NULL;

reductionFactor = 1; //

User::LeaveIfError(iImageDecoder->ReducedSize(

iImageDecoder->FrameInfo().iOverallSizeInPixels,

reductionFactor, decodeimagesize ) );

bitmap = new (ELeave) CFbsBitmap();

bitmap->Create( decodeimagesize, iImageDecoder->FrameInfo().iFrameDisplayMode);

bitmap->LockHeap(ETrue);

bitmapaddress = (TUint8*)bitmap->DataAddress();

1 2  下一页

Tags:symbian bitmap 处理

编辑录入:coldstar [复制链接] [打 印]
赞助商链接