Click here to Skip to main content
15,888,269 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

How to copy Image Buffer from unsigned char * to CxImage ?

CxImage is the third party library - Image processing function

C++
//////////// Copying from cximage to unsigned char *

CxImage CxBuffer;

unsigned char * uc_Buffer = CxBuffer.GetBits();

////// HOW TO DO IN REVERSE //////////////////



COPYING FROM unsigned char * to CxImage ?????
Posted
Updated 24-May-12 18:05pm
v2

1 solution

Use

CreateFromArray (BYTE* pArray,DWORD dwWidth,DWORD dwHeight,DWORD dwBitsperpixel, DWORD dwBytesperline, bool bFlipImage)


to convert an existing binary representation of an image into a CxImage object.
 
Share this answer
 
Comments
Pixel86 28-May-12 22:23pm    
DWORD dwBytesperline -> i am not sure about this parameter , please explain me.
i am using 8 bit image ( 1400 * 1024 ) - so how much it would come for DWORD dwBytesperline??
nv3 29-May-12 3:18am    
It's the number of bytes per line, just as the name suggests. In your case it is probably 1400. The parameter exists, because there are images that use slack bytes to fill up each line to multiple of 4 bytes or some other number. Hence the number of bytes per line is not always exactly the number of bytes per pixel times the number of pixels per line.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900