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 8714671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:39:17+00:00 2026-06-13T05:39:17+00:00

I am programming some graphical filters in my main program which is based upon

  • 0

I am programming some graphical filters in my main program which is based upon C#.
However C# is not fast for getpixel / putpixel.
I’ve seen workarounds for it, using unsafe code in C#

Unsafe code gives me a bit an unsafe feeling too, as i understand the benefit of safe code and memory cleanup.

So now i am wondering….

Might it be better to write this unsafe code in a separated dll based on C++ ?.
However I never made mixed language programs, so i am wondered.

  • How would one pass a bitmap from C# to a function in a C++
    i can set the reference to the dll, but i dont think that will be enough
  • How would one pass some returned values and the bitmap back again to the c# main program

Also what if i used another compiler to write the c++11 .dll would that be a problem?
The main program is written in visual studio 2010 expres

  • 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-13T05:39:18+00:00Added an answer on June 13, 2026 at 5:39 am

    If you use C++ then you also can use C# with unsafe code. Both is unsafe and in C# you still don’t need to care about memory cleanup. The only thing you have to care about is accessing invalid pointers which will cause a AccessViolationException.

    public unsafe void SwapChannels(Byte[] imageSrc)
    {
        fixed (Byte* pImageSrc = imageSrc)
        {
            // Swap channels here
        }
    }
    

    I’m using unsafe code in my image libraries too. If you are not going cross-plattform you can also use C++/CLI.

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

Sidebar

Related Questions

I want to get myself into programming some serious GUI based applications, but when
I have done some computer graphical programming recently, and I have no experience before.
I was doing some .NET programming in WPF which involved reading .png and .txt
I'm doing some graphics programming using the Gosu gem. The thing is, when I
I'm relatively new to graphics programming, and I've just been reading some books and
Hi programming some C# in a form with a bunch of group boxes. I
I was programming some stuff in a Xcode project, then I decided to move
I'm programming some websites with JSP-Scripting and I encounterd a strange problem with urlencoded
I'm programming some C code using gcc -std=C89 switch on a Linux box. This
I have about 4-5 years of background in programming some in C# and some

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.