<UserControl x:Class="CtrEditor.ObjetosSim.ucCustomImage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vm="clr-namespace:CtrEditor.ObjetosSim"
        xmlns:funcionesbase="clr-namespace:CtrEditor.FuncionesBase">

    <UserControl.DataContext>
        <vm:osCustomImage />
    </UserControl.DataContext>

    <UserControl.Resources>
        <funcionesbase:BooleanToDoubleConverter x:Key="FlipConverter" TrueValue="-1" FalseValue="1"/>
    </UserControl.Resources>

    <Grid RenderTransformOrigin="0.5,0.5">
        <Grid.RenderTransform>
            <TransformGroup>
                <ScaleTransform 
                    ScaleX="{Binding Horizontal_Flip, Converter={StaticResource FlipConverter}}" 
                    ScaleY="{Binding Vertical_Flip, Converter={StaticResource FlipConverter}}"/>
                <RotateTransform Angle="{Binding Angulo}"/>
            </TransformGroup>
        </Grid.RenderTransform>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

    <Image Source="{Binding ImageSource_oculta}"
            Width="{Binding Ancho, Converter={StaticResource MeterToPixelConverter}}"
            Height="{Binding Alto, Converter={StaticResource MeterToPixelConverter}}" 
            Stretch="Fill"
            RenderTransformOrigin="0.5,0.5" />

    </Grid>

</UserControl>
