15,908,931 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 vvozar (Top 4 by date)
vvozar
7-Mar-11 13:02pm
View
Just read about DC's. I am trying to find out how to get my forms window handle, so I could get device context for that window(client DC). As 'mbue' said, i should get client DC to paint on it, because up in the code i am using device context of entire screen. Maybe that's the cause of repainting issue. Does anyone know how to get device context for painting on client area of the window? Or how to get my windows handle (HWND)?
vvozar
5-Mar-11 16:27pm
View
What do you mean by 'client DC'?
vvozar
5-Mar-11 14:00pm
View
Code in FormPaint method looks like this for now:
<pre> void __fastcall TfrmMainForm::FormPaint(TObject *Sender)
{
odButton1->clearFrame();
odButton2->clearFrame();
}
</pre>
This my first time working with Device Context, Brushes, Regions, Rectangles... I'm not quite sure am i using Device context correctly.
"OnPaint you should get a DC you can paint in (thats the client dc)" - what do you mean exactly? Do you mean that i should get DC in FormPaint method, modify clearFrame(...) method and pass that DC as a parameter?
(thanks for info about brushes, i'll add
DeleteObject(brush);
at the end of the method)
vvozar
4-Mar-11 16:28pm
View
Deleted
Some more precise information.I am coding in C++ using Borland C++ Builder, including VCL library (creating forms with 'drag and drop' technique). Actually, I created form (for now it's just that first form initially created when you start new project) and put two image components on it (VCL library, Additional Tab, dragged and dropped Image component on form).
This way i added two IDE Managed Components of 'TImage *' type (named img1 and img2):
TImage* img1;
TImage* img2;
Each 'TImage*' object/component has its own Picture property, which is of TBitmap type. So, in Object Inspector i have assigned proper bitmap images to Picture properties.