15,912,400 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Bob Namenottaken (Top 9 by date)
Bob Namenottaken
11-Jul-11 8:38am
View
Thank you. I understand that - I just don't like the idea of wasting the time with the copy. But I'm ok if "that's the way it is". I was just wondering if experienced programmers had a tcehnique to avoid the copy.
Bob Namenottaken
9-Jul-11 12:40pm
View
What I meant was you draw everything onto your in-memory screen-sized array and then call the Invalidate function when done. When WM_PAINT comes along you paint the whole thing in one shot.
I understand you could get more complicated and detect regions that have changed and start invalidating based on regions, etc. I suppose you could even use a timer to invalidate, set a flag to stop drawing, update the screen and then clear the flag... and myriad other ways, too... I really appreciate your insight. My son and I are going to play around with this over weekend.
Bob Namenottaken
9-Jul-11 8:05am
View
This now makes me wonder why so many programmers discuss the use of double buffering. It seems to me this technique of 1) create in-memory, 2) invalidate, 3) WM_PAINT is inherently double-buffering. Why so many articles advising double buffering and how to do it?
Bob Namenottaken
8-Jul-11 20:09pm
View
The code works, thanks again.
Bob Namenottaken
8-Jul-11 19:24pm
View
Thank you so much!
Bob Namenottaken
8-Jul-11 18:19pm
View
Ahh, that's a serious issue I never knew. So you maintain an in-memory image of your screen (assuming you're drawing images to the screen), then call a Validate or Update function and then Windows graciously invites you to WM_PAINT your screen? (At which time you use your example code to transfer your in-memory image to the screen?)
Bob Namenottaken
8-Jul-11 18:01pm
View
Or am I completely mis-reading the example code and wrongly assuming it is used for WM_PAINT responses?
Bob Namenottaken
8-Jul-11 18:00pm
View
Why is it necessary to perform this only in response to WM_PAINT? Do programs need to update a locally-owned in-memory bitmap and then wait for a WM_PAINT to get it on the screen? I realize WM_PAINT is needed in case the program is minimized, re-sized or moved - but can't a program just put a bitmap on the screen anytime anywhere in its code?
Bob Namenottaken
8-Jul-11 17:39pm
View
Thank you, I'm going to play around with this tonight. I always thought Windows functions should've been more obvious (with a prefix of win_) for example.
I really appreciate the assistance with this. I was actually going to add that I didn't need code, just a list of the minimal requirements - but this is great!
Show More