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

The Archive Base Latest Questions

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

Is there a way to manipulate alpha of an image using alpha from another

  • 0

Is there a way to manipulate alpha of an image using alpha from another image?

Suppose I have a Image and I want to alter its alpha starting opaque at left and totally transparent at right, currently I draw another image with LinearGradientBrush and set alpha of orginal image from second image by looping pixel by pixel, is there another way in Gdiplus, some image mask, or blending alpha of two images?

Conclusion: it seems there is no way in GDI+ to blend two images, only way seems to be the manual way by iterating thru pixels.

  • 1 1 Answer
  • 1 View
  • 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-11T21:19:02+00:00Added an answer on May 11, 2026 at 9:19 pm

    I think you’re correct in that you have to do this pixel-by-pixel. I’ve also searched for a more “pure” way to do it, but this is what I ended up with:

        public enum ChannelARGB
        {
            Blue = 0,
            Green = 1,
            Red = 2,
            Alpha = 3
        }
    
        public static void transferOneARGBChannelFromOneBitmapToAnother(
            Bitmap source,
            Bitmap dest,
            ChannelARGB sourceChannel,
            ChannelARGB destChannel )
        {
            if ( source.Size!=dest.Size )
                throw new ArgumentException();
            Rectangle r = new Rectangle( Point.Empty, source.Size );
            BitmapData bdSrc = source.LockBits( r, ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb );
            BitmapData bdDst = dest.LockBits( r, ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb );
            unsafe
            {
                byte* bpSrc = (byte*)bdSrc.Scan0.ToPointer();
                byte* bpDst = (byte*)bdDst.Scan0.ToPointer();
                bpSrc += (int)sourceChannel;
                bpDst += (int)destChannel;
                for ( int i = r.Height * r.Width; i > 0; i-- )
                {
                    *bpDst = *bpSrc;
                    bpSrc += 4;
                    bpDst += 4;
                }
            }
            source.UnlockBits( bdSrc );
            dest.UnlockBits( bdDst );
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to manipulate an image(crop) using javascript in IE? I know
Is there a way to manipulate the mouse position without using System.Windows.Forms.Cursor? Something like
Is there a (clean) way to manipulate some text from std::cin before inserting it
Is there any way to manipulate, from an Applet, the DOM of a HTML
I am using Grails and I want to manipulate my playlist from YouTube. I
Is there a way to manipulate multiple values of a tuple without using a
Is there any way to manipulate an image with CSS3/Mootools to create the 3D
Is there a way to manipulate the size of a non-displayed UIView from outside
Is there a way to manipulate non-global variables from a fileevent handler? Consider the
Is there a way to manipulate Domain object after the validation is completed in

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.