CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: icons

  1. #1
    Join Date
    Nov 2000
    Location
    Tokyo and Memphis
    Posts
    238

    icons

    OK, I have an icon. But it's a square. It is isn't transparent. How do I get it to show only the picture rather than the background?

    Many thanks

    Phil


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: icons

    Your icon is really an icon with tranparent bakground( you can see it using window explorer)? If so, how you display it (on icon property of form, in a picturebox, in an imagebox...)? if you need a transparent picture, try with ImageBox control.
    Hope this help.
    Cesare Imperiali

    Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Nov 2000
    Location
    Tokyo and Memphis
    Posts
    238

    Re: icons

    Hi There

    I'm trying to do 2 things

    1/ get a picture of a cat to slide over the backdrop of my form without the white that surrounds the cat. Animation, I guess.

    2/ Make my mouse pointer that same cat - even if it is a small one.

    Many thanks

    Phil



  4. #4
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: icons

    There is a nice sample at
    Http://www.freevbcode.com/code/bitmap_region.zip that shows you how to create a tranparent bitmap.

    With this you should be able to "Skin" your cat.
    Here is some of the Header information regarding the sample.
    '
    '
    Use a Bitmap to Create a Skinnable Irregular-Shaped Form
    Author: Elad Rosenheim (Developer of the Month)
    Category: Screen/Graphics
    Type: Applications
    Difficulty: Advanced


    Version Compatibility: Visual Basic 5 Visual Basic 6


    More information: A lot of applications today allow custom bitmaps ("skins") to be used as the user-interface/background to the program - Take Winamp for example.

    Some applications (such as the MP3 players Sonique and kjofol) allow you to use non-rectangular bitmaps with transparent sections.

    The following demo does just that. I'm no graphics artist, though, so to create a better-looking skin you'll have to work hard - but the code is here for you to do it.

    Note that you can move the form by pressing and dragging the mouse anywhere on the form - even though it doesn't have a title bar.




    John G

  5. #5
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: icons

    A decent icon designer program for Windows should be available for download somewhere. The resource editor that comes with Visual C++ is an example. (If not, I might even write one myself).

    The basic way an ICON works is that it contains 2 bitmaps - an AND bitmap which is the coloured bitmap and an XOR bitmap which defines the shape to 'cut out' of the background to put the AND bitmap in.
    In your case the XOR bitmap is just a square, whereas you need to change it to be the shape of your AND bitmap and it will act like a "proper" Windows ICON.
    You can use the same image as a pointer as well.

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

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