Hi All,
I am concatenating TIFF images image1 and image2 of CMYK pixel format with same height. For that I am copying the pixels to Buffer1 and Buffer2 then combining the both buffers to BUFF.
Code:
//Image1 Dimensions
UINT Width = 150;
UINT Height = 100;
UINT Stride = Width * 3 ;
Stride = ((cbStride + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD);
BYTES * Buffer1 = NULL;
BYTES * Buffer1 = new BYTE[Stride * Height];
//Here the pixels are copied to Buffer using GDI+ as follows
//WICRect rc = { 0, 0, Width, Height };
//piFormatConverter->CopyPixels(&rc, Stride, Stride * Height, Buffer1);
//Image2 Dimensions
UINT Width2 = 150;
UINT Height2 = 100;
UINT Stride2 = Width2 * 3 ;
Stride = ((Stride2 + sizeof(DWORD) - 1) / sizeof(DWORD)) * sizeof(DWORD);
BYTES * Buffer2 = NULL;
BYTES * Buffer2 = new BYTE[Stride2 * Height2];
//Here the pixels are copied to Buffer using GDI+ as follows
//WICRect rc = { 0, 0, Width2, Height2 };
//piFormatConverter->CopyPixels(&rc, Stride2, Stride2 * Height2, Buffer2);
// ... Now I want to Combine the Pixels of Buffer1 + Buffer2 so that to create a single image using the same GDI+ method as follows.
BYTE * BUFF=NULL;
UINT BUFFSize = (Stride + Stride2) * Height;
BUFF = new BYTE[BUFFSize];
memcpy(BUFF,pbBuffer,(cbStride * uHeight));
GdiPlusBitmap = new Bitmap(Width+Width2, Height, (Stride+Stride2), PixelFormat32bppCMYK, BUFF);
But here the combined memory through created image is black & white and not sharp.
I hope some experts here can guide me with some work arounds.
Thanks & Regards,
Madhav