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. drawing bitmap

drawing bitmap

Scheduled Pinned Locked Moved C / C++ / MFC
graphicscomquestion
3 Posts 3 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.
  • K Offline
    K Offline
    K Shaffer
    wrote on last edited by
    #1

    How can you draw a bitmap outside of OnPaint() function? calling "CPaintDC dc(this)" outside of OnPaint() compiles and executes, but doesnt work. Kevin Shaffer kshaff03@msn.com

    J R 2 Replies Last reply
    0
    • K K Shaffer

      How can you draw a bitmap outside of OnPaint() function? calling "CPaintDC dc(this)" outside of OnPaint() compiles and executes, but doesnt work. Kevin Shaffer kshaff03@msn.com

      J Offline
      J Offline
      Jorgen Sigvardsson
      wrote on last edited by
      #2

      CDC* dc = GetDC();
      dc->BitBlt(...);
      ReleaseDC(dc);

      -- Sancte Míchael Archángele, defénde nos in proélio contra nequítiam et insídias diáboli esto præsídium. Imperet illi Deus, súpplices deprecámur: tuque, princeps milítiæ cæléstis, Sátanam aliósque spíritus malígnos, qui ad perditiónem animárum pervagántur in mundo, divína virtúte, In inférnum detrude. Amen.

      1 Reply Last reply
      0
      • K K Shaffer

        How can you draw a bitmap outside of OnPaint() function? calling "CPaintDC dc(this)" outside of OnPaint() compiles and executes, but doesnt work. Kevin Shaffer kshaff03@msn.com

        R Offline
        R Offline
        Ryan Binns
        wrote on last edited by
        #3

        Jorgen's method is one way. Another is to use CClientDC(this)

        Ryan

        "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

        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