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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:18:19+00:00 2026-05-11T19:18:19+00:00

I have two bitmap images. One contains a picture taken with a usb camera.

  • 0

I have two bitmap images. One contains a picture taken with a usb camera. The other will contain a shape, like a rectagle, but it can also be a trapezoid, or lets say, a random shape with only one color in it. The rest of the image is white right now.

The two images aren’t of the same size but scaling algorithms aren’t the most difficult part here, so lets assume they are of the exact same dimensions.

I want to show my shape on the usb camera picture. The white part will be considered as transparent for the combinaison purpose. Right now I’m thinking of editing the image pixels by pixels, but I’m searching for an API which will do it for me.

So if I take a picture with a house in the middle of it and overlay a red rectagle, the resulting image will have the original picture with a red rectangle around the house.

I’m using .NET if this can help. I could also use win32 API if it contains some useful functions.

Edit :
I accepted the answer since it put me on the right track. This is actually super easy to do.

Bitmap^ overlay_image = gcnew Bitmap("overlay.bmp");
Bitmap^ original_image = gcnew Bitmap("original.bmp");
overlay_image->MakeTransparent(Color::White);
Graphics^ g_original = Graphics::FromImage(original_image);
g_original->DrawImage(overlay_image, 0, 0);

Voilà, original_image now has a red rectangle over it. It is actually fast enough for my 30fps usb camera so I can get it in real time.

There is no scaling done right now. Also, it assumes that the overlay image background is white, which will be made transparent.

  • 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-05-11T19:18:19+00:00Added an answer on May 11, 2026 at 7:18 pm

    If you are using the full .NET platform, System.Drawing.Imaging has functions for alpha channels and masking:

    http://www.codeproject.com/KB/GDI-plus/alphafx.aspx

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

Sidebar

Related Questions

i have two bitmap images ..and i need to merge the bitmaps with precise
I have written an anaglyph filter that mixes two images into one stereographic image.
Possible Duplicate: Combine two Images into one new Image I have a c# code
I have two images moving across the screen, one is a ball and one
Android: I have two byte arrays one byte array of bitmap and another byte
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two classes (MVC view model) which inherits from one abstract base class.
i have two Activity in this i take pixels of image from one activity
I have two bitmaps that differ only by color. The green one is used
I have a process that does a composite of two images, and it works

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.