symbian bitmap 处理图片 png jpg jpeg bmp
2010-07-04 15:33:00 来源:WEB开发网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();
- ››处理报错:java/lang/NoClassDefFoundError: java...
- ››Symbian S60 SocketConnection参数
- ››Symbian乏力:2010年诺基亚悲情大事记
- ››Symbian三大升级开启2011年新战略
- ››Symbian/Android/iOS/WM安装包对比
- ››Symbian一个活动对象的测试例子
- ››Symbian ListBox控件
- ››Symbian下自动切换SDK的批处理代码
- ››Symbian 3 版的 Swype 输入法正式上架
- ››Symbian中的设计模式
- ››Symbian S60平台JAVA开发环境搭建步骤
- ››Symbian自定义控件—如何实现跑马灯效果
更多精彩
赞助商链接