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. Image Processing - problem with copying data

Image Processing - problem with copying data

Scheduled Pinned Locked Moved C#
helpgraphicsdata-structures
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.
  • M Offline
    M Offline
    Michael O
    wrote on last edited by
    #1

    Hi, I would like to generate a bigger ouptut texture from the small sample. I lock bits and copy them to byte array. Next I copy bytes to the output byte array and again lock bits and create output Bitmap. Everything works properly when OutputImage.Width % 4 = 0, if output image width (in pixels) is diffrent than 0 I get strange image! I tryed to make something with PixelFormat, but it didn't give any effects. thanks for any help :)

    L 1 Reply Last reply
    0
    • M Michael O

      Hi, I would like to generate a bigger ouptut texture from the small sample. I lock bits and copy them to byte array. Next I copy bytes to the output byte array and again lock bits and create output Bitmap. Everything works properly when OutputImage.Width % 4 = 0, if output image width (in pixels) is diffrent than 0 I get strange image! I tryed to make something with PixelFormat, but it didn't give any effects. thanks for any help :)

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Images have logical dimensions (width and height), and their in memory representation has physical dimensions. They typically have a "stride", which equals the number of bytes (or pixels?) you should advance in order to get to the next scanline. Assuming all numbers are positive, stride>=width will hold true, stride==width may or may not be true. See also BitmapData.Stride :)

      Luc Pattyn

      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