I'm trying to create a custom image component so that I can have it
with a border and rounded corners.

I tried doing it by just extending the image component, but quickly
found that it was a bit more difficult than I expected within the
image component - as I couldn't figure out how to move the image
itself around when drawing the border.

So the second solution I came up with was as follows:

* A custom component which has a child as the image
* The image has a mask applied
* The border is drawn using the custom components graphics

This all works out pretty much OK, except for two issues:

1) The child image is only ever displayed if the custom component
extends the Canvas component.

2) Resizing of the component does not work in the same way as resizing
an image component - e.g. if you set a width on an image component
then the image is scaled appropriately. With me extending the Canvas I
just get scroll bars.

The code for the component can be found here on pastie:
http://pastie.org/326072

Any ideas are greatly appreciated.

Reply via email to