Jump to content
Tuts 4 You

C++ Style Toolkit


enhzflep

Recommended Posts

Just found a great article on CodeProject a few minutes ago and it just seemed too good not to share. I realize many of you will visit there already. But this just seemed like a gem, worthy of mentioning.

The idea is to programmatically build up an image using layers, in much the same way as Photoshop. After these layers have been assembled, a single bitmap is created showing the result of combining them. This means that re-draws are lightning-quick, since all the hard-work has already been done, and the code is just blasting a HBITMAP back onto the screen.

Like all articles it comes with full source, though you've got to be a member to download them. So I'll just provide a link to the original article as well as the downloads for it.

P2_TealPane.png

This image above was created using the shield as a png, and just 7 lines of code! - OOps, I mean 9 lines of code.

P1_DemoProgram.png

This image just shows some of things possible.

I'm a bit of two minds, as to whether our std practice of including images for everything is going to be better, or if this appraoch will be better. I suppose that if it doesn't suit you, you can always return it :tongue:

No, to be fair - the thing I like about it most, is the ability to provide a complex interface that the user can customize the colours of at run-time, without us having to (a) include as many different colour schemes as we can think of, or ( B) do all the dirty work needed to colorize images used for interface items. In any case, it seems pretty damn neat from where I'm sitting.

You can read the article here: [s]http://www.codeproject.com/KB/cpp/Style_Toolkit.aspx

[EDIT] The article has since been moved to: http://www.codeproject.com/KB/GDI-plus/Style_Toolkit.aspx

- thanks Azmo.

StyleToolkit_src.zip

StyleToolkit_exe.zip

StyleToolkit_demo_src.zip

Edited by enhzflep
Link to comment
  • 3 weeks later...

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
×
×
  • Create New...