Hi,
'Fingerprint raw data' means 8 bit gray data that consist information. So how to display that using extern bitmap? I have also attached externbitmaploader.c file. please have a look.
from this file I set offset=1 manually and get image but it display black cross line, black line at bottom and also it display image verticle flipped(image 1). if i dosent set offset manually and let it be calculated it self then it display like in image 2.
Can you please give some deep document on offset.
Thanks,
Chand Bhadaniya
#include "ewrte.h"
#include "ewgfx.h"
#include "imagedata.h" // contain imgdt[28056]
#include <stdint.h>
uint8_t imgdt[28056]; // Raw data for image
XBitmap* EwLoadExternBitmap( XString aName )
{
XPoint size;
XBitmap* bitmap;
XBitmapLock* lock;
unsigned char* ptr;
int offset;
int x, y;
/* ==> TODO: Access your image and query all necessary data. At least
we need the width and the height of the image in order to allocate
the bitmap */
/* In our simple example, we just use a fixed size */
size.X = 167;
size.Y = 167;
/* Now, create a new empty bitmap with the previously determined size and format */
bitmap = EwCreateBitmap( EW_PIXEL_FORMAT_ALPHA8, size, 0, 1 );
/* If the creation has failed */
if ( !bitmap )
return 0;
/* Lock the entire bitmap for the write only operation */
lock = EwLockBitmap( bitmap, 0, EwNewRect( 0, 0, size.X, size.Y ), 0, 1 );
/* Get the pointer to the bitmap pixel memory */
ptr = (unsigned char*)lock->Pixel1;
offset = lock->Pitch1Y - size.X;
printf("offset = %d\n", offset);
offset = 1; // image1 as contain offset =1, when comment this line we got image 2
/* ==> TODO: Decode your image and copy row by row and pixel by pixel
from your decoded image into the bitmap. */
int pix =0;
/* Fill the bitmap row by row */
for ( y = 0; y < size.Y; y++, ptr += offset )
for ( x = 0; x < size.X; x++, ptr++ )
{
*ptr = imgdt[pix];
pix++;
}
/* finally, unlock the bitmap */
EwUnlockBitmap( lock );
/* Return the filled bitmap */
return bitmap;
}

