Used some online code example to put a little project to display raw image. The display does not seem to work.
For some purposes, I like this to work with a dialog based MFC project.XDVView is derived from CScrollView.
see OnInitDialog() and OnDraw(CDC* pDC).8bit 768x756
For some purposes, I like this to work with a dialog based MFC project.XDVView is derived from CScrollView.
Could you define these"some purposes" to work with a dialog based rather than a SDI MFC project?
BTW, your code in XDVView::OnDraw has a resource leak (you call ::GetDC but do not call the ReleaseDC)
Last edited by VictorN; November 28th, 2012 at 03:54 PM.
Got a dialog based MFC that is 100% done. Would be nicer to draw a few raw images continuously using a pop up dialog. Worked with SDI long time ago and do not see major point to port everything to SDI. This is not a major show just a few continuous captures and displays. image is 8bit grayscale. There are many similar reasons in the forum.
There was a bug in filling the buffer. Now, my problem is, I can not scroll to view entire image. it re-draws the top half only. It needs improvements. attached.
Why do you SetDIBitsToDevice to ::GetDC() rather than to CDC* dc) passed in by the framework?
Besides, you leak the resources since you do not call the ReleaseDC
since i use SetDIBitsToDevice(dc->GetSafeHdc(),.. , then I do not need to call the ReleaseDC, right?. If the buffer passed to the SetDIBitsToDevice is refreshed, I have to call the Invalidate to (refresh the) display the current data in the buffer, right?. I wrote a bit of code to test this. I like to read some inputs as well.
since i use SetDIBitsToDevice(dc->GetSafeHdc(),.. , then I do not need to call the ReleaseDC, right?
Yep!
Originally Posted by lch2
If the buffer passed to the SetDIBitsToDevice is refreshed, I have to call the Invalidate to (refresh the) display the current data in the buffer, right?
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.