Solved

Image processing in Visual C++

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 111
only14 challenge 19 68
Use of condition with 'serial' in ansible 2 49
Excel file not created as expected 7 48
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now