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

  • Home
  • SEARCH
  • 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 842887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:02:14+00:00 2026-05-15T06:02:14+00:00

Using GDI+ I’ve made a heatmap bmp and I’d like to superimpose it on

  • 0

Using GDI+ I’ve made a heatmap bmp and I’d like to superimpose it on top of my bmp map. I’ve saved the two bmps to disk, and they look good, I just need a way to put them together. Is there any way to do this, perhaps using the Graphics object? How is transparency/alpa involved?

I’m very new to GDI programming so please be as specific as possible.


OK – here’s an answer. At some point I need to learn how GDI+ works…

I couldn’t get around the transarency issues, but this works. It just copies the non-white pixels from the overlay to the map:

        for (int x = 0; x < map.Width; x++)
            for (int y = 0; y < map.Height; y++) {
                Color c = overlay.GetPixel(x, y);
                if ((c.A != 255) || (c.B != 255) || (c.G != 255) || (c.R != 255))
                    map.SetPixel(x, y, c);     
  • 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-15T06:02:15+00:00Added an answer on May 15, 2026 at 6:02 am

    This should do the job…

    At the moment the Image you want to superimpose onto the main image will be located in the top left corner of the main Image, hence the new Point(0,0). However you could change this to locate the image anywhere you want.

    void SuperimposeImage()
            {
                //load both images
                Image mainImage = Bitmap.FromFile("PathOfImageGoesHere");
                Image imposeImage = Bitmap.FromFile("PathOfImageGoesHere");
    
                //create graphics from main image
                using (Graphics g = Graphics.FromImage(mainImage))
                {
                    //draw other image on top of main Image
                    g.DrawImage(imposeImage, new Point(0, 0));
    
                    //save new image
                    mainImage.Save("OutputFileName");
                }
    
    
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to display some text in my program using (say) Windows GDI and
I'm attempting to display some text in my program using (say) Windows GDI and
I noticed using task manager that the following code has a GDI leak in
I am using gdi c++, StretchDIBits function sometimes failed if I draw large Images
I'm painting this object in C# using GDI and I need to have precise
im trying to create ball animation using gdi but i can't get it working.
ok im trying to create cursor using gdi. i can't even find tutorial how
In Windows XP the Win32 API renders the controls using GDI/GDI+. Now I'm on
I'm developing a graph control in WPF. I have previously developed it using GDI
i draw the circle in c# using directx.i like to draw the circle with

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.