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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to get bimap of a form

How to get bimap of a form

Scheduled Pinned Locked Moved C#
graphicsquestiontutorial
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.
  • S Offline
    S Offline
    sumeat
    wrote on last edited by
    #1

    I want to display the bitmap of an active form, in a MDI app, in a picture box. The picture box control is on the MDI form, whenever user changes the current active form, the picture box control should show the picture of the active form. I want to know how do I get the picture of the active form. One method I can think of is: 1. Get the Graphics object of the active form 2. Get the HDC from the graphics object 3. Create a blank bitmap of the same size as the size of the form. 3. Use Win32 function BitBlt and copy the pixel data from the form's hdc to the bitmap's hdc. Save the bitmap to a file and show the file in the picture box. Is there any other (simpler) way to do this? Thanks suhas

    J 1 Reply Last reply
    0
    • S sumeat

      I want to display the bitmap of an active form, in a MDI app, in a picture box. The picture box control is on the MDI form, whenever user changes the current active form, the picture box control should show the picture of the active form. I want to know how do I get the picture of the active form. One method I can think of is: 1. Get the Graphics object of the active form 2. Get the HDC from the graphics object 3. Create a blank bitmap of the same size as the size of the form. 3. Use Win32 function BitBlt and copy the pixel data from the form's hdc to the bitmap's hdc. Save the bitmap to a file and show the file in the picture box. Is there any other (simpler) way to do this? Thanks suhas

      J Offline
      J Offline
      jtmtv18
      wrote on last edited by
      #2

      i did it that way above. I really dont know of a easyier way to do it though, either way its easy to do it above. the codeproject has a class that someone wrote that has all the api work done for your. Jesse M The Code Project Is Your Friend...

      S 1 Reply Last reply
      0
      • J jtmtv18

        i did it that way above. I really dont know of a easyier way to do it though, either way its easy to do it above. the codeproject has a class that someone wrote that has all the api work done for your. Jesse M The Code Project Is Your Friend...

        S Offline
        S Offline
        sumeat
        wrote on last edited by
        #3

        Thanks for the response. How do I get the class that has all the API work done. Thanks

        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