我用摄像头获得了一帧图像的数据,存储在一个unsigned char*型的缓冲区中,请问如何才能将这帧图像显示到picture control控件上啊?我指的不是一个bmp文件,而是一块缓冲区中的图像数据。而且处理时不要存成文件。
请教大家了!请不吝赐教!在线等
请教大家了!请不吝赐教!在线等
解决方案 »
- PreTranslateMessage 怎么使用
- 这段宏定义如何做成函数
- 又是unicode问题,快疯掉了,两天问了N个UNICODE问题,烦就推荐本书吧,再崩溃就不行了。
- 为什么写文件时,写进去的内容是乱码阿
- MFC定义一个公共类以提供公共变量,数组怎么实现?
- ***请教有关自绘 Windows 窗口的问题***
- 简单问题,如果我自定义消息#define MYMSG WM_USER+100是否会跟别的程序冲突?
- mfc dialog显示
- MFC在Unicode字符集下读写文件
- 怎样从edit控件中读出多行的多个数据?
- 我用HOOK 进行DLL注入为什么发送一次消息执行多次,绝对不是所谓的键盘按下弹起之类的!
- 100分问题链接,,是关于wav文件追加的,,
int nWidth,
int nHeight,
UINT nPlanes,
UINT nBitcount,
const void* lpBits );
Parameters
nWidth
Specifies the width, in pixels, of the bitmap.
nHeight
Specifies the height, in pixels, of the bitmap.
nPlanes
Specifies the number of color planes in the bitmap.
nBitcount
Specifies the number of color bits per display pixel.
lpBits
Points to a short-integer array that contains the initial bitmap bit values. If it is NULL, the new bitmap is left uninitialized.
Return Value
Nonzero if it is successful; otherwise, it is zero.
谢谢大家了
我现在写了一个就是不行
bitmap.CreateBitmap(320,240,1,24,display); CWnd* pWnd=GetDlgItem(IDC_REMOTEVIDEO);
pWnd->UpdateWindow();
CDC* pDC=pWnd->GetDC();
CDC bitmapDC;
bitmapDC.CreateCompatibleDC(pDC);
CBitmap* pOldBitmap = bitmapDC.SelectObject(&bitmap);
pDC->BitBlt(0,0,320,240,&bitmapDC,0,0,SRCCOPY);
bitmapDC.SelectObject(pOldBitmap);
bitmapDC.DeleteDC();
bitmap.DeleteObject();
问题出在哪了
For a color bitmap, either the nPlanes or nBitcount parameter should be set to one. If both parameters are set to one, CreateBitmap creates a monochrome bitmap.Although you cannot directly select a bitmap for a display device, you can select it as the current bitmap for a memory device context by using CDC::SelectObject and copying to any compatible device context by using the CDC::BitBlt function.
唉...有没有哪位编写过类似的啊