Solved

Image processing in Visual C++

Posted on 1998-08-14
1
332 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unix / Linux grid computing 5 157
set up trigger (or something) to rename files (starting with ATL) in a linux directory 6 53
post4 challenge 28 100
noX challenge 17 117
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.

809 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