Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8351867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:46:42+00:00 2026-06-09T08:46:42+00:00

I am writing a C++/Cli interop layer that sits between a native library providing

  • 0

I am writing a C++/Cli interop layer that sits between a native library providing image read from disk using opencv. The interop layer should convert the image to a managed bitmap, then send it to a c# ui.
The actual conversion is trivial by copying the memory. The problem is, this application must process many large images, so it is very resource intensive. Because of this, I would like to avoid keeping two copies of the image in memory, and rather reassign the pointer to the image data in the managed bitmap to point to the opencv image data.
My initial thought was that I could just lock the managed bitmap and assign the Scan0 pointer to the opencv pointer, then make sure the Stride was set to the widthStep of the opencv image (I am using a normal IplImage), but when I do this, the image that comes out is completely black.
Is there any way to create a managed Bitmap without copying the native image data into it?

Thanks,
Max

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:46:44+00:00Added an answer on June 9, 2026 at 8:46 am

    Turns out there is a constructor provided that can do this, see

    http://msdn.microsoft.com/en-us/library/zy1a2d14.aspx

    make sure the opencv image isnt going out of scope though!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an application that has both CLI and GUI. I read most
I recently started writing a C++/CLI wrapper for a native c++ library. I'm now
Title explains. I have native C++ dlls that I'm writing C++/CLI wrappers for, which
I'm writing my first class library using C++/CLI and I've encountered an error when
I am writing a managed wrapper in C++/CLI (VS2010) for a third-party unmanaged library.
I'm writing a simple blog using Django, and I'm including a Python CLI script
Writing htaccess that allows me to remove index.php from the URL can confuse search
I was writing a CLI-Tool for Mac OS X (10.5+) that has to deal
I'm writing a music player in python, with a cli using urwid. I intend
I'm writing a PHP script that I want to disable from web access (I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.