Sign in to follow this  
AntonyCoder

[.net] WinAmp style gui skins possible in C#? How?

Recommended Posts

Hi, I'm creating a media application, and we'd like to switch to a more stylish winamp style skin for our gui. is it at all possible? I mean, how does winamp/media player etc create such lovely looking graphic interfaces using standard winapi controls? Would I need to write my own gadgets in C# or are there specific gadgets designed to handle skins? Any advice/tips/tutorials would be great.

Share this post


Link to post
Share on other sites
Well, you could start with this old article on flipcode if that's of any use.

When it comes to the buttons presses etc I don't see anything wrong with catching the MOUSEPRESSED messages and simply checking against a selection of rectangular hotspots.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
So essentially, use gdi or some form of image based gadget to construct the visual representation of the image, and then do custom bound checking based on mouse press events?

It's certinally doable, but really I'd prefer something a little more tied into the C# way of doing things. (I.e for a button press I just double click on a gadget and fill out it's event)
No way for me to achieve this?

Also an important factor I didn't mention, is abstract window sizes? I.e instead of just a square or rect, how they go about these windows that have complex shapes? Are they somehow defined with a bitplane? or bitmap?

Or are people just hacking their way through this stuff without much support from windows?

C# is my only option btw, so I can't switch to C++ or a custom gui, the project relies on too many C# wrote dlls.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Just checked the tutorial, would have been perfect if we were using C++, but can't I'm afraid. Does much of it still apply to C# do you know? Specifically, are regions possible in C#? (I only started C# gui deving a few days ago so this is all new to me)

Share this post


Link to post
Share on other sites
If you can wait a few months to ship a product, you may want to check out XAML, WPF and the like which will be accessible from C#3.

There are third party libraries available that already have a go at the XAML, but I'm not sure if MS's spec is 100% fixed yet.

You could look around for C# implementations of XUL too.

Here's a link to WPF anyway http://www.microsoft.com/products/expression/en/wpf/default.mspx

EDIT: The tutorials posted above about Win32 can be achieved in C# using a similar techique just different api.

http://www.codeproject.com/csharp/bmprgnform.asp?df=100&forumid=33223&exp=0&select=1141588

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thanks paul, some useful stuff, especially the last link.

So it seems regions are the best way to go then? One last question, will regions allow non rectangular windows? (It appears so but I'd still rather know for sure before I begin)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thanks, a useful tutorial. A little confused though, the tutorial paul linked me seems to achieve the same effect without customly scanning the pixel data for scanlines. Is this because A)I've not looked hard enough or B) they've added new functionality since your tutorial? (I ask because i would like to use the most up to date method possible)

Share this post


Link to post
Share on other sites
That article uses the same approach, just a lot slower (but compilable without the /unsafe switch). Calling .GetPixel repeatedly like that is very slow.

Share this post


Link to post
Share on other sites
Ok thanks for clearing that up, i'll use your tutorial as a basis then. Btw are there any sites you know that offer free skins for programmers to used? I.e in generic bmp format instead of custom skin formats?

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
C# is my only option btw, so I can't switch to C++ or a custom gui, the project relies on too many C# wrote dlls.


As I know about C#, it is possible to use all Win32 functions with adding their dlls in the middle of your codes and easily use them. No need to switch to C++. Sometimes we have to do that.
You can search and find how to do that.

Nima Nf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this