Are Memory DC's faster than Window DC's

Are Memory DC's faster than Window DC's

Post by chelse » Sun, 30 Jun 1996 04:00:00



I am using Window DC's to make GDI calls and then interpreting the data
from the DC pixel by pixel using GetPixel.  Would it be faster to make
the GDI calls to a memory DC and read from the memory DC?

Do you have a faster method of getting ALL the individual pixel values
(COLORREFs) in a DC instead of using GetPixel 1000's of times?

Thanks!

 
 
 

Are Memory DC's faster than Window DC's

Post by Ed McCrear » Tue, 02 Jul 1996 04:00:00



> I am using Window DC's to make GDI calls and then interpreting the data
> from the DC pixel by pixel using GetPixel.  Would it be faster to make
> the GDI calls to a memory DC and read from the memory DC?

> Do you have a faster method of getting ALL the individual pixel values
> (COLORREFs) in a DC instead of using GetPixel 1000's of times?

It's be better to copy the image in the DC to a DDB and then convert
it to a DIB giving you complete access to the pixels.

--
Ed McCreary                             #include <witty.txt>

http://www.neosoft.com/~forge

 
 
 

Are Memory DC's faster than Window DC's

Post by Mike Pit » Sat, 06 Jul 1996 04:00:00




>> I am using Window DC's to make GDI calls and then interpreting the data
>> from the DC pixel by pixel using GetPixel.  Would it be faster to make
>> the GDI calls to a memory DC and read from the memory DC?

>> Do you have a faster method of getting ALL the individual pixel values
>> (COLORREFs) in a DC instead of using GetPixel 1000's of times?
>It's be better to copy the image in the DC to a DDB and then convert
>it to a DIB giving you complete access to the pixels.

Yes.  Or, if you are using Win32, create a DIBSection, associate it
with a memory DC, then call your GDI APIs on that DC.  When you are
finished you will have your buffer of pixels without any intermediate
conversion steps.

-Mike

 
 
 

1. Printer DC's and Enhanced Metafile DC's and Memory DC's

I am having problems selecting a bitmap created via
CreateCompatibleBitmap() into a memory DC created via CreateCompatibleDC()
whose "hardware" DC is actually a metafile which was created from a printer
DC.  Whew!  

I can find no limitation in the documentation for doing this but
SelectObject() returns NULL when I try to select the compatible bitmap into
the compatible DC of the compatible EMF DC of the printer DC.   Have I
missed something in the docs?  Is this a bug?  If it is a bug, what's the
work-around?

Any help would be appreciated.

E.C.
--
Eric Chamberlain                eric dot chamberlain at graphicode dot com
GraphiCode, Inc.                Senior Software Engineer
6608 216th St. SW               Phone: (425) 672-1980
Suite 100                       Fax:   (425) 672-2705
Mountlake Terrace, WA 98043
USA                             Web Site: http://www.graphicode.com
**********************************************************************
*  Pursuant to US Code, Title 47, Chapter 5, Subchapter II, Sec. 227,
*  any and all nonsolicited commercial E-mail sent to this address is
*  subject to a download and archival fee in the amount of $500 US.
*  E-mailing denotes acceptance of these terms.
**********************************************************************

2. ls -l causes bus error

3. How to copy a window's DC to another DC?

4. HELP -- Time Synchronization

5. How to capture a hidden window/dialog into 'Memory DC"

6. Year 2000

7. ASP/ADSI Page to Change passwords

8. Is DC a memory dc ?

9. MFC: Help needed copying images from memory DC to display DC

10. MFC: Copying images from memory DC to display DC?

11. ExtTextOut to memory DC's in Win2K versus Win98

12. ImageLists and Memory DC's