Solved

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

Posted on 1998-03-22
3
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1412214
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
ID: 1412215
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
ID: 1412216
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

707 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