Is CreateCompatibleDC device independent? Why would it act differently for drives

This is a discussion on Is CreateCompatibleDC device independent? Why would it act differently for drives within the Windows Programming forums, part of the Platform Specific Boards category; All, I am creating a memory device context and a bitmap using the following code: CBitmap bitmap; CBitmap* pOldBitmap; CDC ...

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    1

    Is CreateCompatibleDC device independent? Why would it act differently for drives

    All,

    I am creating a memory device context and a bitmap using the following code:

    CBitmap bitmap;
    CBitmap* pOldBitmap;
    CDC dcMemory;
    dcMemory.CreateCompatibleDC(Givendc);
    bitmap.CreateCompatibleBitmap(Givendc, nWidth, nHeight);
    pOldBitmap = dcMemory.SelectObject(&bitmap);

    Everything works great. I create the bitmap, draw my object on it and print it. However, the fonts look differnt in adobe pdf versus the edoc printer. How do I make sure the fonts stay the same? How do I create a compatible DC that is driver independent? I thought CreateCompatibleDC was suppose to do that. Can someone help?

  2. #2
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,855
    DCs are device independent but bitmaps are not.

    Look at DIBs (Device Independent Bitmaps)

    However you issue is probably more to do with scale/resolution.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. CreateCompatibleDC() vs RestoreDC
    By csonx_p in forum Windows Programming
    Replies: 3
    Last Post: 04-14-2008, 01:52 AM
  2. Replies: 4
    Last Post: 06-30-2004, 03:11 PM
  3. SCSI drivers... device conflict... no CD drives
    By CodeMonkey in forum Tech Board
    Replies: 2
    Last Post: 09-10-2003, 06:48 AM
  4. CreateCompatibleBitmap & CreateCompatibleDC
    By XSquared in forum Windows Programming
    Replies: 7
    Last Post: 08-21-2003, 01:53 AM
  5. MFC, CreateCompatibleDC question.
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 05-13-2003, 12:29 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21