The power of pink?

I just came across this, and I was wondering on how to achieve this with Juce. :mrgreen:

Currently I use 9 pictures for that, but if I could just use one, it would sure be easier…


Maybe another solution? Just trying to figure out a way of making a better skin option,


good lord, are people still doing that? :frowning:

Alpha-channeled PNGs for the win.

Regards the scaling thing, frankly if I was going to go to the hassle of inventing a meta-language around a colour, I’d just as easily just create a binary, or bit-flag mask of the image, that describes the same data, but provides for greater flexibility.

A 2 bit mask provides at least the facility to define :

0 - no stretch
1 - x stretch allowed
2 - y stretch allowed
3 - x/y stretch allowed.

Of course, in most cases a simple XML descriptor would be more efficient than a bitmask, and would easily cover the majority of scaling definitions.

It’s a sort of neat trick, I guess… but as valley said, you could do a whole lot better. I guess if the goal is to let people create suitable images using only an image editor and nothing else, then it sort of works. Reminds me of the kind of old-school hacks they used to use writing games back in the '80s.

Things like this just make me more eager to get my new Drawable designer running! It’ll be absolutely perfect for this kind of thing!

Good to know, thanks guys. I was also wondering about a simple XML solution myself. :oops:


Hummm, actually, why not stick to 9 images, BUT, have it in a single PNG. Now, the PNG filename could contain the sizes of each of the 9 areas. Unless that makes too big of a file, in that case, just a xml that goes along the PNG that defines those areas.

Plus, if its a button, the png could have all 3 button states inside it. Again, the xml would define the height of each image. Actually, it would be total height / 3, for buttons. :wink:

Sounds like fun?


Actually, the pink idea is still good, I just need to figure a bit things out…


I haven’t read the docs yet, but can I copy a part of an image to a new empty image? Or that’s just not possible?


Of course it’s possible - you can draw anything you want into an image!

Thanks Jules. I guess I can also create my own Image with my own width and height settings, right? Tomorrow I will take a look at the docs.

Once I have something ready, I will post the code here. I’m sure some other people will make good use of it.

I don’t know how Reaper does it, but I want to do it in a simpler way. Divide the image into 9 images, and just use my current drawSquare code. :mrgreen: BUT, thinking of this again, it would be better to just stretch the middle and middle-sides areas, instead of my fill-it-all solution…


So I finished up my code, finally! :smiley:

please do :slight_smile: people will forget about those crazy hacks and promote themselves to the new millennium