Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1998-03-22
3
Medium Priority
?
183 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 150 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

610 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