Dynamic form support for images
hashitha opened this issue ยท 8 comments
Shouldn't be hard, I'll do some quick experiments and I'll let you know
I pushed master
<img src="captcha.png" />
[Image("captcha.png")]
These are the requirements for src
- Value can be a string representing a path (I think even http works)
- Value can be an ImageSource, which is displayed as is
- Value can be a dynamic resource that resolves to a string or an ImageSource, if it's a string go to step 1, if it's an ImageSource go to step 2
I haven't tested it as an inline element to see how it looks, but I think we need to be able to support aligning and size properties of the image. Maybe we should allow an overriden <img width=... height=... align="left|center|right">
I will give this ago now and get back to you
It works well. Looks like we need to allow <img width=... height=... align="left|center|right">
I was working on that. layout is crucial for images.
I added these attributes:
<img src="..."
width="auto|number"
height="auto|number"
align="left|center|right|stretch"
valign="top|center|bottom|stretch"
stretch="none|fill|uniform|uniformtofill"
direction="both|uponly|downonly" />
Defaults:
width = auto
height = auto
align = stretch
valign = center
stretch = uniform
direction = downonly
Note: if you need to make an image bigger you need to change direction
Pull latest commit for a bug fix.
This works well and it also works with an URL as an image source.