ScaleTransform scaleTransform = new ScaleTransform(scaleFacotr, 1); canvas.RenderTransform = scaleTransform;
canvas.Width=initialCanvasWidth*scaleFacotr
scaleFacotr value is 2. We are multiplying x coordinate of every point with 2 and multiply ycoordinate of every point with 1. This thing I understand. I want to confirm does it also mean the point on a line which was taking 1 pixel will now take 2 pixels along x axis What I have tried: <pre> <ItemsControl ItemsSource="{Binding Lines}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Canvas Height="12000" Margin="0,30,0,0" Background="Transparent" Name="front_canvas" ClipToBounds="True" PreviewMouseWheel="OnPreviewMouseWheel" Width="{Binding CanvasWidth, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Line X1="{Binding From.X , Mode=TwoWay}" Y1="{Binding From.Y, Mode=TwoWay}" Stretch="None" X2="{Binding To.X, Mode=TwoWay}" Y2="{Binding To.Y, Mode=TwoWay}" Stroke="OrangeRed" StrokeThickness="1" Loaded="Line_Loaded" /> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)