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. Managed C++/CLI
  4. Graphics Object on indexed Bitmap

Graphics Object on indexed Bitmap

Scheduled Pinned Locked Moved Managed C++/CLI
graphicshelpquestion
2 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.
  • C Offline
    C Offline
    cherrymotion
    wrote on last edited by
    #1

    Hi there, I have a huge problem with Graphics Object. My application shows pictures in a picturebox. Now I want to draw multiple frames (rectangles) onto the shown image (regions of interest). The most easy and acceptable way is to create a graphics object from the image and do the drawRectangle function on it. If the image is scaled or zoomed the rectangle(s) will always grow and shrink in same relations! this is very important! Problem: My bitmap is format8bppindexed with a monochrome colorPalette added by myself, so I isn't possible to create a graphics object! It's very important, that I can refresh the images as fast as possible (best with just changing the scan0 pointer). Is there a possible way to get a graphics object from such an image? Or has anyone an idea how I could come up with that rectangle drawing thing? I would be so happy about a good answer! Thanks and have a nice day...

    M 1 Reply Last reply
    0
    • C cherrymotion

      Hi there, I have a huge problem with Graphics Object. My application shows pictures in a picturebox. Now I want to draw multiple frames (rectangles) onto the shown image (regions of interest). The most easy and acceptable way is to create a graphics object from the image and do the drawRectangle function on it. If the image is scaled or zoomed the rectangle(s) will always grow and shrink in same relations! this is very important! Problem: My bitmap is format8bppindexed with a monochrome colorPalette added by myself, so I isn't possible to create a graphics object! It's very important, that I can refresh the images as fast as possible (best with just changing the scan0 pointer). Is there a possible way to get a graphics object from such an image? Or has anyone an idea how I could come up with that rectangle drawing thing? I would be so happy about a good answer! Thanks and have a nice day...

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I've personally always kept regions of interest separate from the image, just drawing the ROIs at render time instead of drawing on the actual image data. A couple possibilities: 1) Use double buffering. Use a graphics object created for a bitmap with the same bit depth as the screen. Draw the image to the graphics, draw the ROIs on the graphics, and render the bitmap to the screen. 2) Use GDI directly via platform invoke.

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      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