CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2004
    Posts
    1,361

    Help with pink icons and transparency

    I want to use some of the images in the VS2005ImageLibrary as icons for buttons (IE: I need an UP arrow). This has a variety of images and types. The .png images work just fine.

    However the ones I need have the pink background which is supposed to be a transparency key. I can only achieve two effects.

    1. A black arrow with a pink background on my button.

    2. A black arrow on my button that has transparency, but it is transparency to my desktop. IE: You can move the form around and see through it to other applications or desktop images.

    I just want the uparrow (and a few other ones) where the pink is transparent to the control it is on and no further. Does anyone know how to do this?

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Help with pink icons and transparency

    I think you'd need to edit the picture in an appropriate program such as FireWorks etc.
    In FireWorks ( for example ), you'd need to set the pink to be transparent.
    Talking under correction here, but you may have to save the picture as JPG instead.
    But try editing the picture in an appropriate program, as I suggested, and see if it works

  3. #3
    Join Date
    Aug 2005
    Location
    Seattle, Wa
    Posts
    179

    Re: Help with pink icons and transparency

    You could use a picturebox control.

    Load the image into the picturebox, setting the transparency.
    Code:
    Bitmap bmpPicture = (Bitmap)Bitmap.FromFile("arrow.png");
    bmpPicture.MakeTransparent(Color.Pink);
    pictureBox1.Image = bmpPicture;
    This will work as you expect...

    -C6

  4. #4
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Help with pink icons and transparency

    Did you try EXPLICITLY setting the color of your control to something other than "CONTROL"????
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  5. #5
    Join Date
    Sep 2004
    Posts
    1,361

    Re: Help with pink icons and transparency

    As to the last, the answer is yes. I tried hot pink, orange, black, and white.

    As to editing the pictures, well these are the "provided" ones from Microsoft. I would assume they are ready to use. Why would they give me 200 standard icons (like the gadgets you see all over dev studio itself) and then expect you to have to edit them to make them work?

    These are located:
    "C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\VS2005ImageLibrary"

    Your path might vary, but that is the general idea. In that folder you will find a zip file with all the standard icons you see everywhere.

    You can even see a lot of the hot pink icons being uses in the dev studio UI, only they are missing the hot pink part. There has to be some kind of option or value I need to set that will make them work properly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured