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. Bitmap Image Processing Using C#

Bitmap Image Processing Using C#

Scheduled Pinned Locked Moved C#
helpcsharpgraphics
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
    karthick sampangi
    wrote on last edited by
    #1

    Hi, I want to read the Bitmap Image using C# and i'm trying to display these image in 0's and 1's please help me to solve the problem. :(( :confused:

    P D 2 Replies Last reply
    0
    • K karthick sampangi

      Hi, I want to read the Bitmap Image using C# and i'm trying to display these image in 0's and 1's please help me to solve the problem. :(( :confused:

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

      karthick sampangi wrote:

      I want to read the Bitmap Image using C#

      use LockBits() to obtain the bitmat data.

      karthick sampangi wrote:

      i'm trying to display these image in 0's and 1's

      good luck :thumbsup:

      regards :)

      1 Reply Last reply
      0
      • K karthick sampangi

        Hi, I want to read the Bitmap Image using C# and i'm trying to display these image in 0's and 1's please help me to solve the problem. :(( :confused:

        D Offline
        D Offline
        DaveyM69
        wrote on last edited by
        #3

        The first thing you need to do is get a byte[] (byte array) of the image. You can use BitmapData from the LockBits as suggested before, or possibly save the bitmap to a MemoryStream and get the byte array from the stream. Getting the binary display is then trivial, just use Convert.ToString on each byte:

        foreach (byte index in byteArray)
        {
        Console.WriteLine(Convert.ToString(index, 2).PadLeft(8, '0'));
        }

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

        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