public static void ApplyTextModifications(Text txt, InkCanvas canvas) { txt.TextContent = txt.TextContent.ToUpper(); txt.TextSize = 72; txt.FontWeight = FontWeights.Bold; Text.SetTxtWidthAndHeight(txt); var position = canvas.CanvasTopCenterCoordinates(txt.Width, txt.Height); canvas.SetObjectPositionOnCanvas(txt, position.X, position.Y); }
public static void ApplyCenterPictureModifications(Picture pic, InkCanvas canvas) { var rel = pic.Width/pic.Height; if (pic.Width >= pic.Height) { pic.Width = canvas.Width*2/3.5; pic.Height = pic.Width/rel; } else { pic.Height = canvas.Height*2/3; pic.Width = pic.Height*rel; } var position = canvas.CanvasCenterCoordinates(pic.Width, pic.Height); var shiftDown = canvas.Height/12; canvas.SetObjectPositionOnCanvas(pic, position.X, position.Y + shiftDown); }
public static void ApplyRightPictureModifications(Picture pic, InkCanvas canvas) { var rel = pic.Width/pic.Height; pic.Width = (canvas.Width/2)*4/5; pic.Height = pic.Width/rel; if (pic.Height > canvas.Height*5/6) { pic.Height = canvas.Height*4.5/6; pic.Width = pic.Height*rel; } var position = canvas.CanvasRightHalfCenterCoordinates(pic.Width, pic.Height); var shiftDown = canvas.Height/12; canvas.SetObjectPositionOnCanvas(pic, position.X, position.Y + shiftDown); }