Solved

how can I keep track of changes in a Bitmap in view

Posted on 1998-03-22
3
174 Views
Last Modified: 2013-12-03
Iam facing a problem regarding Bitmap. Actually iam displaying a bitmap on my view. If bitmap's height and width exceeds my view size then, scrollbar will appear. Ok. Now iam providing a pencil using which the user can edit/draw something on the bitmap.

Now, for the bitmaps of bigger size(ie: in which case scrollbar is coming), when user scrolls down and draw something on the bitmap area, how do i keep track of that change in the original bitmap. [iam not able
to keep track of that change, and when redraws that change goes off].
Hope now u got the problem. If u have any idea regarding this, please let me know.

0
Comment
Question by:Jayaraj_J
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
Comment Utility
You should use a off-screen bitmap, which is held in a memory DC. The off-screen bitmap is full-size. Whenver the users make some changes, it should be recorded on the off-screen bitmap. The bitmap you display on your view is just a part of the off-screen bitmap.
0
 

Author Comment

by:Jayaraj_J
Comment Utility
I am using MSDN January-98. Is there any sample programs which demonstrates this off-screen bitmap handling. Or can you give me an idea how to create and handle an off-screen bitmaps? please.
0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
The idea is:
1. Create a memory DC;
2. Load the bitmap;
3. Selete the bitmap into the memory DC;
4. Always BitBlt from the memory DC to the screen DC when you draw it;
5. Whenever the users draw on the screen, draw it on the memory DC and update the screen.

Because the screen view size may be smaller than the bitmap, you need to keep a rectangle which you can use for coordinates translation between the screen view and the off-screen bitmap.
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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 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

9 Experts available now in Live!

Get 1:1 Help Now