Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. 890916 - resizing a memory dc

890916 - resizing a memory dc

Scheduled Pinned Locked Moved C / C++ / MFC
graphicsperformancequestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ilostmyid2
    wrote on last edited by
    #1

    hi i need to create a memory dc with a specified dimensions. one way is to select a created or loaded bitmap in it which has the desired dimensions. is there any way else? thx

    P 1 Reply Last reply
    0
    • I ilostmyid2

      hi i need to create a memory dc with a specified dimensions. one way is to select a created or loaded bitmap in it which has the desired dimensions. is there any way else? thx

      P Offline
      P Offline
      pasztorpisti
      wrote on last edited by
      #2

      The HDC is just a drawing interface to 'something'. The DC itself does not have a size. It is usually backed by a window, a printer, or a bitmap. You always have to retrieve the size of the underlying object that backs the DC. This can be the client are of the window, the whole window, the size of the paper in your printer, the size of the bitmap or whatever. If your memory DC is backed by a bitmap, then you are right, you have to select another bitmap to the DC to change the size.

      I 1 Reply Last reply
      0
      • P pasztorpisti

        The HDC is just a drawing interface to 'something'. The DC itself does not have a size. It is usually backed by a window, a printer, or a bitmap. You always have to retrieve the size of the underlying object that backs the DC. This can be the client are of the window, the whole window, the size of the paper in your printer, the size of the bitmap or whatever. If your memory DC is backed by a bitmap, then you are right, you have to select another bitmap to the DC to change the size.

        I Offline
        I Offline
        ilostmyid2
        wrote on last edited by
        #3

        thank u :) i did this and the problem was resolved:

        Ct2View::d\_tmpDC.CreateCompatibleDC(&dc);
        bitmap.DeleteObject();
        bitmap.CreateCompatibleBitmap(&dc, Ct2View::d\_itemSize.cx, Ct2View::d\_itemSize.cy);
        Ct2View::d\_tmpDC.SelectObject(&bitmap);
        
        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups