CreateFromArray quit working

http://www.xdp.it/cgi-bin/yabb2/YaBB.pl?num=1132285336

Hi Davide
First thanks for this software - its great!

I was working with CxImage for couple of months, and it works great. In some point it quit. I call CreateFromArray and it does nothing to the object. GetLastError returns an empty string. What I’m doing is convert a buffer I get from my webcam to a jpeg image. I call this function on a callback function from the windows Video Capture.
I did not change a thing in my code or linking.
Here is the relevant part of the code:
Code:

LRESULT PASCAL FrameCallbackProc (HWND hWnd, LPVIDEOHDR lpVHdr)
{
/* Get the Format struct. */
int size = capGetVideoFormatSize (hWnd);
char* format = new char [size];
capGetVideoFormat (hWnd, format, size);

/* Make CxImage from the buffer received from webcam driver.*/
CxImage image;
image.CreateFromArray ((BYTE*)lpVHdr->lpData,
((BITMAPINFO*)format)->bmiHeader.biWidth,
((BITMAPINFO*)format)->bmiHeader.biHeight,
((BITMAPINFO*)format)->bmiHeader.biBitCount,
((BITMAPINFO*)format)->bmiHeader.biWidth *
((BITMAPINFO*)format)->bmiHeader.biBitCount / 8,
FALSE);

...

I do not think the problem is with CxImage but I probably changed some thing in the system. I don't know what.

Did you bump into this problem in the past?

Any lead will be most appreciated
Thanks
Erez Bibi

http://dcru-server.com
Back to top 

Found the problem
The BitPerPixel was set to 12 I had to set it to 24 and set the compression to None.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值