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#
  4. trying to create a bitmap from 8bit greyscale using System.Drawing.Bitmap

trying to create a bitmap from 8bit greyscale using System.Drawing.Bitmap

Scheduled Pinned Locked Moved C#
graphics
2 Posts 1 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.
  • A Offline
    A Offline
    aei_totten
    wrote on last edited by
    #1

    DisplayBitmap = new System.Drawing.Bitmap(camera.width, camera.height, stride, System.Drawing.Imaging.PixelFormat.Indexed, camera.MonocromeFrame); This gives me an invalid argument (System.Drawing.Imaging.PixelFormat.Indexed) DisplayBitmap = new System.Drawing.Bitmap(camera.width, camera.height, stride, System.Drawing.Imaging.PixelFormat.Format24bppRgb, camera.MonocromeFrame); gives me the image but it is 3 times as wide and just repeats

    A 1 Reply Last reply
    0
    • A aei_totten

      DisplayBitmap = new System.Drawing.Bitmap(camera.width, camera.height, stride, System.Drawing.Imaging.PixelFormat.Indexed, camera.MonocromeFrame); This gives me an invalid argument (System.Drawing.Imaging.PixelFormat.Indexed) DisplayBitmap = new System.Drawing.Bitmap(camera.width, camera.height, stride, System.Drawing.Imaging.PixelFormat.Format24bppRgb, camera.MonocromeFrame); gives me the image but it is 3 times as wide and just repeats

      A Offline
      A Offline
      aei_totten
      wrote on last edited by
      #2

      tried Bitmap temp = new System.Drawing.Bitmap(camera.width, camera.height, stride, System.Drawing.Imaging.PixelFormat.Format24bppRgb, camera.MonocromeFrame); DisplayBitmap = new Bitmap(temp.Width,temp.Height); for(int y=0;y and it lagged beyond compare because it is a huge image. The board retarded my for loops here is a link to the code [No Paste version of the code](http://rafb.net/p/bK4NOv64.html) [[^](http://rafb.net/p/bK4NOv64.html "New Window")]

      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