Then don’t apply a rotation transform to the light and shade aspects. If I recall, doesn’t Juce have some image compositing operators? Like Photoshop’s “Lighten”, “Darken”, “Screen”, “Multiply”, etc… transfer modes? Those are quite useful for applying lighting effects.
Not exactly. I would just draw the control using Graphics, period. No need to draw into an Image and then copy it to the screen, unless you want to use more advanced image compositing operators like the ones I described.
In my app, I accomplish lighting and shadow effects by drawing shaped gradient fills, where the color goes from fully opaque white = RGBA(255, 255, 255, 255) to fully transparent white = RGBA(255, 255, 255, 0) for lighting, and fully opaque black = RGB (0, 0, 0, 255) to fully transparent black (0, 0, 0, 0) for shadows.
Draw the knob face with a transform, and then overlay the lighting and shadow effects to exclude the transform.
For really nice looking knob shadows you can use the Gaussian Blur code I posted. Draw the knob in all-black into a separately allocated Image with associated transparency channel, then use my Gaussian Blur class to create a pixel-accurate blurred image which includes a blurred transparency channel and handles the edge pixels correctly. Copy the blurred image to the screen, with the drop shadow offset, then draw your knob over that with no offset. Juce also has a Component drop shadow class somewhere. After you draw the knob with a transform you can overlay some lighting, using white at various levels of transparency.
Here’s my blur class:
Fast Image Convolution Using Radial Symmetry (with source)
Not only is this orders of magnitude faster O(N) instead of O(N^2) where N is the blur radius but it correctly handles edge pixels and transparency.