Click here to Skip to main content
Click here to Skip to main content
Go to top

iTunes Image

, 26 Oct 2006
Rate this:
Please Sign up or sign in to vote.
An iTunes look alike image panel.

iTunes Image resume

Introduction

Based on an idea taken from iTunes, I was wondering if it was possible to have a nice resume image for a catalog program. On the left of the screenshot there's the original iTunes Podcast and on the other side the ImageFlip control.

Background

This article is based on the idea to have an image control that simulate the iTunes, a shiny surface that reflects image.

The control is composed of the original image with a spectacular transparency shaded copy of itself. The control is totally transparent, so the reflected image can overlap any kind of background.

By the way, the most useful thing here is the code or the idea. So it is usable to create a bigger control with descriptions and buttons, or in a web page to dynamically create an image, maybe a PNG.

Using the code

The control usage is defined by the Image and Divider properties.

  • Image defines the source image. An example could be an 80x80 pixel size.
  • Divider defines the reflected image height, in fractions of the source image. Example: Divider=2 means a 40 pixel reflected height.

So, the total height of the control becomes 80 + 40 = 120 pixel height.

The control is sizeable, but it does not affect in any way the image; it could be useful only to crop it. On image assignment, the control autosizes to the calculated dimensions.

Just a warning: the control is totally transparent without an image, so it's easy you can lose it in the parent form Smile | :)

Points of Interest

This is the tip found and used to set the control totally transparent:

// Set background trasparent for control
protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        cp.ExStyle |= 0x20;
        return cp;
    }
}

History

This is a pre release and subject to improvements, if I've time to.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

gamon02
Software Developer (Senior)
Italy Italy
No Biography provided

Comments and Discussions

 
GeneralTransparency is lost if the control's location is changed at runtime Pinmemberb_jaysingh16-Jan-08 0:40 
GeneralTransparent Images Pinmembersre7610-Apr-07 20:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 26 Oct 2006
Article Copyright 2006 by gamon02
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid