Solved

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

Posted on 1998-03-22
3
178 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
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 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