First, to answer the OP, you can try to draw the outline as a path, and then use an imagefill to fill the path using your bitmap. This combines the nice scalable outlines of vector drawing witht the ability to use non-trivial gradients on the inside of the button.
Next, jules, not this again. As the developer of a software library you should know better.
At least retina is easy to support with its exact 2× scale factor. In my experience, the 1.25× factor on Windows (aka 120dpi) is the worst.
Vector graphics are not going to magically solve that problem. Both vector graphics and bitmaps can have the problem of having their features, be it pixels or lines, misaligned with the physical pixels on the screen. Both will look shoddy if you don't provide versions for different resolutions.
If you have a 16×16 pixel icon at 1× scale, the only way to make it look acceptable on 1.25× scaling is to have a 20×20 icon. Vector graphics may be easier to scale, but you still must edit your 20×20 icon to align the features to that different pixel grid. And you must make sure that when rendering your icon, you exactly align the image with the physical pixels. There is a good reason why the Windows ICO format supports multiple layers of different sizes.
You also have to take into account details like if you draw that icon in the middle of a 25×25 area, you have to offset by half a pixel or it will look blurry.
Case in point, let's open the IntroJucer:
http://www.juce.com/sites/default/files/forum/attachments/introjucer-dpi.png
Note the ugly artefacts around the tabs in the larger version. Ironically this would look much better if it were using bitmaps for those tabs.
Now let's focus on the icons:
They look very pixellated, which is an artefact of poor downsampling (the resource images are 128×128). If we resize the resource images to 32×32, it looks significantly better, but blurry. This blurryness will not go away if you draw these icons using vector graphics.
And finally the only reason we can get away with using vector graphics a lot these days is this ongoing fad with “flat” user interfaces. This is slowly coming to an end, as more and more people are figuring out it is ruining usability.
--
Roeland