Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 24th, 2006, 1:25 PM   #1
apcx
Newbie
 
Join Date: Apr 2005
Posts: 6
Rep Power: 0 apcx is on a distinguished road
Visual C++ Form Project - need to get HDC for drawing bitmaps

Hi all

I am fairly new to C++, and am having problems creating a quick GUI application using the Win32 API. I'd like to use the "windows form project" option in Visual C++ ...which creates windows, textboxes, buttons etc. through a drag & drop interface.

The problem is that I need to able to create a GUI with controls for user input, but also draw bitmaps on a large area of the window. In order to do this, I need to access the handle to the device context of the (automatically created) window.

How do I get the handle to the device context, for my bitmap-drawing functions? And will I get the HDC out of the actual frame, or a specific picture box? ...

Any help would be much appreciated.
apcx is offline   Reply With Quote
Old Feb 25th, 2006, 7:15 AM   #2
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
There are 2 ways to do that, one using the beginPaint() function, the other is with the GetDC() function.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:53 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC