PDA

Click to See Complete Forum and Search --> : What is a DC?


Sep 26th, 2000, 07:37 PM
Hi.

I know the words: Compatible Device. But what does that means and mainly, why should I use them?

Thanks.

/\/\isanThr0p
Sep 26th, 2000, 09:31 PM
That's one of the most funny posts I ever read here! Not because the question is silly (IT IS NOT!!), but because you can find a HDC in nearly every answer about graphic stuff, and noone is answering this now!

So I think DC means Device Context.

It normaly stores a bitmap (map of pixel).

But when you program and you only have to give a long of course there is no bitmap stored in this long! Actualy it is a Handle to the DC! (hDC)

If somebody know better would be interesting for me, too.

Cu

Sep 27th, 2000, 07:55 AM
Thanks Misanthrop, but I need a little more information.

First, I was off track complettly with my "Compatible Device", it is more "Device Context" (thanks to Misanthrop). And I understand what a "Handle" means (hDC) and why we need it. But why would I use the CreateCompatibleDC, CreateDC, GetDC APIs? These APIs seem to be used in a lot of graphic algorithm. Since I have quite a few graphic problems to solve these days, I'd like to know if this could help me.

So if anyone has more information about that

Thanks.

Fox
Sep 27th, 2000, 11:42 AM
With GetDC for exmaple you can get a window's DC (if you know it's handle, the hWnd). CreateDC is used to... create DCs ;) Empty buffers. CreateCompatibleDC create a DC which 'works for sure', else you have to set several information by yourself.

Hope this helps a bit ;)

/\/\isanThr0p
Sep 27th, 2000, 03:58 PM
Yes that's right fox!

It is just a cool way to greate new DCs for Bitmaps, that fit exactly your needs and You don't need to waste memory and speed with the Pictureboxes!

Sep 28th, 2000, 09:31 AM
All right! That's clear enough.

Thanks!