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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:41:59+00:00 2026-05-16T23:41:59+00:00

I am developing the smart device application in C#. I am new to the

  • 0

I am developing the smart device application in C#. I am new to the windows mobile. I have added the background image to the form in my application by using the following code. I want to make this image transparent so that other controls on my windows form will be displayed properly.

protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            Bitmap CreateCustomerImage = new Bitmap(@"/Storage Card/background.png");
            e.Graphics.DrawImage(CreateCustomerImage, 0, 0);
        }

The background image has blue color. When the application runs the controls such as label, text box & other controls displayed in white color. How to solve this problem? Can you provide me any code or link through which I can solve the above issue?

  • 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-16T23:42:00+00:00Added an answer on May 16, 2026 at 11:42 pm

    I can’t make out if you want to make your controls transparent or an image, but if you want to make an image transparent when drawing it here’s how.

    You need to set a particular pixel as the transparent color as Windows Mobile doesn’t support it “natively”. You need to create an ImageAttributes instance that you use when drawing the image. The example below uses the pixel in the upper left corner as the “transparent color”.

    private readonly ImageAttributes imgattr;
    .ctor() {
        imgattr = new ImageAttributes();
        Color trns = new Bitmap(image).GetPixel(0, 0);
        imgattr.SetColorKey(trns, trns);
    }
    
    protected override void OnPaint(PaintEventArgs e) {
        e.Graphics.DrawImage(image,
                             new Rectangle(0, 0, Width, Height),
                             0, 0, image.Width, image.Height,
                             GraphicsUnit.Pixel,
                             imgattr);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing the smart device application in C#. I am new to the
I am developing smart device application in C#. It is a window application. In
I am developing smart device application in C#. I am able to add the
I am developing smart device application in C#. I am able to add the
I am developing smart device application. In that I am consuming the java web
I am developing smart device application. I want to know whether we need to
I am developing smart device application in C#. In that I am calling the
I am developing smart device application in C#. In that I am calling the
I am developing smart device application in C#. In that I am calling the
I am developing smart device application in C#. When I deploy my application on

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.