|
|
导航: |
论坛 -> 移动应用开发
斑竹:flyers,iamdream |
|
作者: |
|
2014/7/3 0:46:37 |
标题: |
|
加入我的收藏 |
楼主: |
编写了Mobile应用程序,主要用来显示自定义图像格式,解析数据后,计算出每个像素的RGB值,然后写到Image控件中. 编译成Windows版本一切运行正常; 但编译成ios版本,加载到ipad中后,图像颜色与windows上面的不同,请教大家. 显示部分代码(C++版,R、G、B分别是计算好的RGB数组): TBitmapData bm; TAlphaColorRec vPixelColor; Image1->Bitmap->Width = width; Image1->Bitmap->Height = height; Image1->Width = width; Image1->Height = height; Image1->Bitmap->PixelFormat = TPixelFormat::RGB; if(Image1->Bitmap->Map(TMapAccess::maReadWrite, bm)) { for (int h = 0;h < height;++h) { for(int w = 0;w < width;++w) { TAlphaColorRec ac; ac.A = 0xFF; ac.R = R[h * width + w]; ac.G = G[h * width + w]; ac.B = B[h * width + w]; bm.SetPixel(w,h,ac.Color); } } } Image1->Bitmap->Unmap(bm);
----------------------------------------------
- |
|