Zooming Image in WPF -
i try make zoom on image, create style, here :
<style x:key="zoomimage" targettype="{x:type image}"> <style.triggers> <trigger property="ismouseover" value="true"> <setter property="layouttransform"> <setter.value> <scaletransform scalex="1.5" scaley="1.5"/> </setter.value> </setter> </trigger> </style.triggers> </style>
and apply style in window:
<grid name="rootgrid" margin="4,4,4,4"> <grid.columndefinitions> <columndefinition width="130"></columndefinition> <columndefinition width="*"></columndefinition> </grid.columndefinitions> <grid name="infogrid" grid.column="0" margin="4,4,4,4"> <grid.rowdefinitions> <rowdefinition height="150"></rowdefinition> <rowdefinition height="*"></rowdefinition> <rowdefinition height="150"></rowdefinition> </grid.rowdefinitions> <stackpanel name="userpanel" grid.row="0" margin="4,4,4,4"> <border borderthickness="1" borderbrush="black" margin="1,1,1,1" background="whitesmoke"> <image name="userimage" <!--apply style --> style="{staticresource zoomimage}" margin="4,4,4,4"> <image.source> <multibinding converter="{staticresource imageconvertor}"> <binding path="profilephoto"/> <binding path="status" updatesourcetrigger="propertychanged"/> </multibinding> </image.source> </image> </border> </stackpanel> </grid>
but not make o zoom, can problem?
i use guy advance:
<trigger property="ishittestvisible" value="true"> <setter property="layouttransform"> <setter.value> <scaletransform scalex="1.5" scaley="1.5"/> </setter.value> </setter> </trigger>
but, image not zooming if mouse over.
the image not default hit test visible- ishittestvisible="true" in image, or equivalent setter job.
Comments
Post a Comment