Click here to Skip to main content
15,868,420 members
Articles / Multimedia / GDI+
Article

iTunes Image

Rate me:
Please Sign up or sign in to vote.
3.46/5 (11 votes)
26 Oct 20061 min read 35.6K   293   27   2
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 :)

Points of Interest

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

C#
// 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


Written By
Software Developer (Senior)
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

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

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

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