Solved

Image processing in Visual C++

Posted on 1998-08-14
1
339 Views
Last Modified: 2013-11-20
I have managed to do thresholding and thinning to my image using visual C++. The problem is how should i display the image out again...the new image after thresholding?
0
Comment
Question by:cheeonn
1 Comment
 
LVL 8

Accepted Solution

by:
Answers2000 earned 30 total points
ID: 1320790
You haven't made clear where the image is

If it's in a CBitmap/HBITMAP use BitBlt/StretchBlt

If it's in a DIB convert it to a CBitmap/HBITMAP (there are samples called DIB*.CPP that come with the MS VC compiler)

If it's in an Image list, use the draw method.

If it's in a block of memory, convert it to a DIB, then convert it to an HBITMAP/CBitmap then paint it.

You probably want to doing the painting in OnDraw in your view

My suggestion would be to create an extra memory bitmap, and paint this to the view in OnDraw.  Whenever the working image changes update the memory bitmap and force a repaint on the view,  InvalidateRect(NULL,FALSE) then UpdateWindow() on the view.  This avoids have to reprocess the image just to redraw the screen.

If you're short of memory or your bitmap is very large either (i) skip the memory bitmap, or (ii) Make the memory bitmap just screen sized (i.e. the visible/zoomed part of the image) and stretchblt the true image on to it.

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tab names are off by one 5 54
has77  challenge 9 90
wordcount challenge 11 134
I could not set window to top 4 22
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question