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. How can I copy a block of memory?

How can I copy a block of memory?

Scheduled Pinned Locked Moved C#
questiondata-structuresperformance
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
    CopperCircle
    wrote on last edited by
    #1

    Hi, I have an image in memory as an RGB array, I need to make a fast copy of it? I access the image in usafe mode using the following pointer byte* p = (byte*)(void*)pBuffer; I need another copy of the data so that I can create a new pointer to it and leave my origional data unaffected. Thanks...

    L 1 Reply Last reply
    0
    • C CopperCircle

      Hi, I have an image in memory as an RGB array, I need to make a fast copy of it? I access the image in usafe mode using the following pointer byte* p = (byte*)(void*)pBuffer; I need another copy of the data so that I can create a new pointer to it and leave my origional data unaffected. Thanks...

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      I guess you can use System.Runtime.Interop.Marshal.AllocHGlobal to do that. I wouldn't do this in managed code at all but I guess it should work.

      led mike

      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