locked
memory device context and device context RRS feed

  • Question

  • what is memory device context and device context ? difference between them ? Can anybody explain me ?

    Thanks in advance

    BR 

    Wednesday, August 21, 2013 6:26 PM

Answers

  • A device context represents a device (e.g. a monitor or a printer) that you can draw graphics on.

    A memory device context is a special form of device context. It's not backed by a physical device, but by a bitmap image stored in memory.


    Igor Tandetnik

    Wednesday, August 21, 2013 6:33 PM
  • Hi BR:

    A device context is a structure that defines a set of graphic objects and their associated attributes, as well as the graphic modes that affect output. The graphic objects include a pen for line drawing, a brush for painting and filling, a bitmap for copying or scrolling parts of the screen, a palette for defining the set of available colors, a region for clipping and other operations, and a path for painting and drawing operations.

    To enable applications to place output in memory rather than sending it to an actual device, use a special device context for bitmap operations called a memory device context. A memory DC enables the system to treat a portion of memory as a virtual device. It is an array of bits in memory that an application can use temporarily to store the color data for bitmaps created on a normal drawing surface. Because the bitmap is compatible with the device, a memory DC is also sometimes referred to as a compatible device context.


    Sunny Cao
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Anna Cc Tuesday, August 27, 2013 2:29 AM
    Friday, August 23, 2013 9:15 AM

All replies

  • A device context represents a device (e.g. a monitor or a printer) that you can draw graphics on.

    A memory device context is a special form of device context. It's not backed by a physical device, but by a bitmap image stored in memory.


    Igor Tandetnik

    Wednesday, August 21, 2013 6:33 PM
  • Memory DC is normally used for double buffering. Check below article

    Flicker Free Drawing In MFC


    Thanks, Renjith V R

    Thursday, August 22, 2013 1:34 PM
  • Hi BR:

    A device context is a structure that defines a set of graphic objects and their associated attributes, as well as the graphic modes that affect output. The graphic objects include a pen for line drawing, a brush for painting and filling, a bitmap for copying or scrolling parts of the screen, a palette for defining the set of available colors, a region for clipping and other operations, and a path for painting and drawing operations.

    To enable applications to place output in memory rather than sending it to an actual device, use a special device context for bitmap operations called a memory device context. A memory DC enables the system to treat a portion of memory as a virtual device. It is an array of bits in memory that an application can use temporarily to store the color data for bitmaps created on a normal drawing surface. Because the bitmap is compatible with the device, a memory DC is also sometimes referred to as a compatible device context.


    Sunny Cao
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by Anna Cc Tuesday, August 27, 2013 2:29 AM
    Friday, August 23, 2013 9:15 AM