<InkCanvas x:Name="CurrentPage" PreviewMouseDown="CurrentPage_PreviewMouseDown" PreviewMouseUp="CurrentPage_PreviewMouseUp">
<InkCanvas.Background>
<ImageBrush x:Name="CurrentPageImage" Stretch="Uniform" ImageSource="{Binding CurrentTextBook}" />
</InkCanvas.Background>
<InkCanvas.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="scaleTransform" ScaleX="1" ScaleY="1" />
<TranslateTransform x:Name="CurrentPageTranslateTransform" X="0" Y="0"/>
</TransformGroup>
</InkCanvas.RenderTransform>
// When the size at the time of saving is original and the current is current,
// If you simply apply the logic below An error occurs.
double scaleX = currentWidth / originalWidth;
double scaleY = currentHeight / originalHeight;
double newX = point.X * scaleX;
double newY = point.Y * scaleY;
I am working with InkCanvas in C# WPF.
I am using a specific image for the Background Image property of my InkCanvas, and the Stretch of this image is Uniform.
As a result, I am working on drawing a Stroke on the image.
But now a problem arose.
After working the program in window mode, save the stroke If you call Stroke in full screen mode The location and size do not match.
Even with a simple scale calculation method, the position and size of the stroke do not match.
How should I solve it?
I have the total size at the time of saving and the size at the time of loading.
I am also working on the same image. I am working with InkCanvas in C# WPF.
I am using a specific image for the Background Image property of my InkCanvas, and the Stretch of this image is Uniform.
As a result, I am working on drawing a Stroke on the image.
But now a problem arose.
After working the program in window mode, save the stroke If you call Stroke in full screen mode The location and size do not match.
Even with a simple scale calculation method, the position and size of the stroke do not match.
How should I solve it?
I have the total size at the time of saving and the size at the time of loading.
I am also working on the same image.