Solved

Image processing in Visual C++

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

708 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

16 Experts available now in Live!

Get 1:1 Help Now