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. Fast reading of unmanaged buffers.

Fast reading of unmanaged buffers.

Scheduled Pinned Locked Moved C#
csharpgraphicshelpquestion
3 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.
  • P Offline
    P Offline
    Pixinger77
    wrote on last edited by
    #1

    Hi all, I'm working in C# with a unmanged Dll that provides me a pointer to a byte buffer (768x576) that holds some video data. Is there any fast way to access the data and work e.g. with a bitmap object? Currently I'm converting the data by the help of: System.Runtime.InteropServices.Marshal.ReadByte But that is to slow for me. Any suggestions? Thanks, Snow.

    G 1 Reply Last reply
    0
    • P Pixinger77

      Hi all, I'm working in C# with a unmanged Dll that provides me a pointer to a byte buffer (768x576) that holds some video data. Is there any fast way to access the data and work e.g. with a bitmap object? Currently I'm converting the data by the help of: System.Runtime.InteropServices.Marshal.ReadByte But that is to slow for me. Any suggestions? Thanks, Snow.

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You can use pointers in unsafe code, like in this example: MSDN: How to save a .gif file with a new color table by using Visual C# .NET[^] --- b { font-weight: normal; }

      P 1 Reply Last reply
      0
      • G Guffa

        You can use pointers in unsafe code, like in this example: MSDN: How to save a .gif file with a new color table by using Visual C# .NET[^] --- b { font-weight: normal; }

        P Offline
        P Offline
        Pixinger77
        wrote on last edited by
        #3

        Thanks for your hint. But I knew already that I can use pointers and I also used code simiar to the example. What I dont like in this solution is the "byte per byte" transfer to the new buffer. Isnt there a way to copy a complete block (like in C++ "memcpy" wich should be faster than a byte per byte transfer)? Thanks again Snow

        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