Hi, I’m new to programming in C/Photon AND to QNX; I feel like I could use a little advice. I’m trying to write a function that accepts two paths, and outputs a third path. The function must load the bitmaps at those two paths, join them vertically, and save the merged bitmaps to the third paths. I believe I’ve loaded them properly:
PhDim_t dim = {0,0};
PhImage_t finalImage;
PhImage_t bitmapA;
PhImage_t bitmapB;
bitmapA = *PxLoadImage(pathA.c_str(),NULL);
bitmapB = *PxLoadImage(pathB.c_str(),NULL);
//Set final image size to be the wider of the two widths, and the sum of the heights
if (bitmapA.size.w < bitmapB.size.w)
{
dim.w += bitmapB.size.w;
} else {
dim.w += bitmapA.size.w;
}
dim.h += bitmapA.size.h;
dim.h += bitmapB.size.h;
//Create final image of the correct dimensions to hold the two inputs - is this the right route to take?
finalImage = *PhCreateImage(NULL,dim.w,dim.h,Pg_IMAGE_DIRECT_888,NULL,0,1);
//Join the two bitmaps here
//Save the final image to disk
PxWriteImage(pathFinal.c_str(),&finalImage,NULL,Px_IMAGE_BMP,0);
I’m throwing myself on your mercy here; by my code, my inexperience should be fairly obvious. I’ve run a few forum searches and battled with Google for hours trying to find a simple way to do this; if anyone can point me in the right direction I’d be extremely grateful.