Exemplo n.º 1
0
        /// <summary>
        /// Creates cliparea view model from clip area model element
        /// </summary>
        /// <param name="clipAreaElement">ClipArea model</param>
        /// <param name="templateViewModel">Parent template</param>
        /// <returns>Created cliparea view model</returns>
        private static ClipAreaViewModel CreateClipAreaViewModel(ClipAreaElement clipAreaElement, TemplateViewModel templateViewModel)
        {
            ClipAreaViewModel clipAreaViewModel = new ClipAreaViewModel(
                clipAreaElement.Name,
                new Rect(clipAreaElement.Left, clipAreaElement.Top, clipAreaElement.Width, clipAreaElement.Height),
                templateViewModel);

            clipAreaViewModel.JpegQuality = clipAreaElement.JpegQuality;

            return(clipAreaViewModel);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates Clip Area element from ClipAreaViewModel and adds to the OmrPage
        /// </summary>
        /// <param name="page">Page to add element to</param>
        /// <param name="clipAreaViewModel">ViewModel to take data from</param>
        private static void AddClipAreaElement(OmrPage page, ClipAreaViewModel clipAreaViewModel)
        {
            ClipAreaElement clipArea = page.AddClipAreaElement(
                clipAreaViewModel.Name,
                (int)clipAreaViewModel.Width,
                (int)clipAreaViewModel.Height,
                (int)clipAreaViewModel.Top,
                (int)clipAreaViewModel.Left);

            clipArea.JpegQuality = clipAreaViewModel.JpegQuality;
        }