File I'm trying to load is map file. It could be possible to slice image to smaller parts, but I would have to go change all coordinate files too.
What comes to 4 bytes is really 4 bits =) (Indexed BMP).
Size of bitmap I'm trying to read is ~6MB
Currently have tried following methods:
iImageDecoder = CImageDecoder::FileNewL( iFs, aFileName );
TInt w = iImageDecoder->FrameInfo().iOverallSizeInPixels.iWidth;
TInt h = iImageDecoder->FrameInfo().iOverallSizeInPixels.iHeight;
TInt b = iImageDecoder->FrameInfo().iBitsPerPixel;
iBitmap = new (ELeave) CFbsBitmap();
TInt err = iBitmap->Create(iImageDecoder->FrameInfo().iOverallSizeInPixels,iImageDecoder->FrameInfo().iFrameDisplayMode);
//Err is -4 here.
iState = EEncoding;
iImageDecoder->Convert( &iStatus, *iBitmap );
I Think there's some charachter's is bmp header that are same as EOF.
TInt err = file.Open(iFs,aFileName,EFileRead);
HBufC8* fileData = HBufC8::NewL(iFsize);
TPtr8 buffer = fileData->Des();
TInt readBytes =iFs.ReadFileSection(aFileName, 0, buffer, iFsize);
//Only reads 4 bytes;
//After read fileData contais BMÚe
//in hex 0x4D42 0x65DA
//Same happens with following
//TInt readBytes = file.Read(buffer,iFsize);
//TInt l = fileData->Length();
I have also tried RFileBuf and CLineReader without success.
My idea was to read only needed bytes from file and create bitmap of them.
In this way i would not need to process whole bitmap, but only parts of it.
To do this I would need pointer to start of pixels data in .bmp file.
But I don't know any other way than first read file to HBUFC8.