Ask Your Question
0

Problem: draw a image using OpenCV 2.3.1 in MFC application

asked 2012-10-27 21:48:07 -0600

Andy gravatar image

updated 2012-10-27 21:49:28 -0600


Hi ,I'm new to OpenCV. Is there other methods to draw a image in MFC application using OpenCV 2.3.1? CvvImage was a highgui class that was removed from OpenCV from ver. 2.2 ,so I don't want to use it.It will be better if you mail me a simple project. Thank You! My Email: [email protected]

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

answered 2012-10-30 06:33:57 -0600

Andy gravatar image

I find a way to solve it using GDI+. Mat m_src; Here is the implement: Gdiplus::Bitmap bitmap(m_src.cols, m_src.rows, m_src.cols * m_src.channels(),
PixelFormat24bppRGB, (BYTE*)m_src.data); Gdiplus::Graphics graphics(pDC->GetSafeHdc()); graphics.DrawImage(&bitmap, 0, 0);

edit flag offensive delete link more

Comments

@Andy why it does not work?

Dean Feng gravatar imageDean Feng ( 2016-07-19 23:20:53 -0600 )edit
0

answered 2013-04-28 21:40:28 -0600

But there is a problem whit this way! When the width of the image is not the multiple of 4 the gdi+ will show nothing at all; is there any way that don't need byte alliment?

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-10-27 21:48:07 -0600

Seen: 1,813 times

Last updated: Apr 28 '13