Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
dialer.exe 4 58
Dialogbox API leak? 18 81
Microsoft C++ code failing in executable that worked 9 85
VS2015 Redefinition errors 4 29
In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
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…

910 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