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

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

Post by Eric Chamberlai » Sat, 30 Jan 1999 04:00:00



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.
**********************************************************************

 
 
 

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

Post by Eric Chamberlai » Sat, 30 Jan 1999 04:00:00




Quote:> I am having problems selecting a bitmap created via
> CreateCompatibleBitmap() into a memory DC created via

CreateCompatibleDC()
Quote:> whose "hardware" DC is actually a metafile which was created from a
printer
> DC.  Whew!  

Correction.   I was mistaken about the metafile DC being involved.
Actually, I am trying to select a bitmap into a memory DC which was based
directly on a printer DC.  All the CreateCompatibleDC() and
CreateCompatibleBitmap() calls come back OK.  I am just getting a  problem
when attempting SelectObject()....

 
 
 

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

Post by Feng Yu » Sun, 31 Jan 1999 04:00:00


Never tried that, and don't know the answer. Just some comments.

When you do a CreateCompatibleBitmap(CreateCompatibleDC(hPrinterDC)),
what bitmap format do you suppose to get ? color or bitmap ? no one
knows.

When talking to printer DC, you should try to avoid color DDB, use only
b/w DDB and DIB. In this way, you can also avoid your original problem.

BTW, DDB can only be selected into one memory DC at a time.

Feng Y

Quote:

>Correction.   I was mistaken about the metafile DC being involved.
>Actually, I am trying to select a bitmap into a memory DC which was based
>directly on a printer DC.  All the CreateCompatibleDC() and
>CreateCompatibleBitmap() calls come back OK.  I am just getting a  
problem
>when attempting SelectObject()....

--
-------------------------------------------------------
Pacifier Online Data Service Dialup SLIP/PPP User
To register: (360) 693-0325 or telnet pods.pacifier.com
-------------------------------------------------------
 
 
 

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

Post by Eric Chamberlai » Tue, 02 Feb 1999 04:00:00




Quote:> Never tried that, and don't know the answer. Just some comments.

> When you do a CreateCompatibleBitmap(CreateCompatibleDC(hPrinterDC)),
> what bitmap format do you suppose to get ? color or bitmap ? no one
> knows.

Well, since the Printer DC has been created from a DEVMODE set of
parameters, I would expect that the color setup for the printer DC would be
defined and thus passed on to the memory DC created from it.  Am I offbase
in thinking that a printer DC doesn't have a known color format?

Quote:

> When talking to printer DC, you should try to avoid color DDB, use only
> b/w DDB and DIB. In this way, you can also avoid your original problem.

Actually, I am actually writing to the bitmap, not using it for canned
graphics or anything like that.  I would like to avoid the complexities of
DIBSections if possible . . .

Quote:

> BTW, DDB can only be selected into one memory DC at a time.

Yes. I have confirmed that that particular behavior is not my problem here.

  == Eric ==

 
 
 

1. Are Memory DC's faster than Window DC's

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!

2. Gigabar or WIS bar??? Which do people like better?

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

4. Urgent Help Needed!!!!!.

5. copying printer DC state into enhanced metafile

6. net view equivelant in samba

7. Is DC a memory dc ?

8. WebServer, IE and user home directories

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

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

11. PrintPreview - Problem inTrying to copy Printpreview' DC's image

12. Getting a printer DC without calling `PrintDlg' routine

13. Printer DC's in Win16