コード例 #1
0
        public ezBackGround(Slide sld)
        {
            id = "SlideBackGround";
            ezCss css = new ezCss(576, 420, 0, 0);

            image     = new ezImage(sld);
            image.css = css;
            backgroundCount++;
        }
コード例 #2
0
ファイル: ezImage.cs プロジェクト: masudme09/PowerPointStudio
        private void ShapeExportOption(Shape shape, ShapeExportOptions exportOptions)
        {
            //Export the image of the shape
            int slideWidth  = (int)Utility.SlideWidthGet((shape.Parent).Parent);
            int slideHeight = (int)Utility.SlideHeightGet((shape.Parent).Parent);

            string shapeExportDirectory = PowerPointStudioRibbon.currentPPTPath + "\\images";

            if (!Directory.Exists(shapeExportDirectory))
            {
                Directory.CreateDirectory(shapeExportDirectory);
            }

            //Need to set rotation property 0 before export then set back to original
            float originalRotation = shape.Rotation;

            try
            {
                shape.Rotation = 0;
            }catch
            {
            }

            string exportedUrl = "";
            //shape name may contain character that are not qualify as file name so need to remove those
            //Qulify shape Name
            string qulifiedShapeName = Utility.qulifiedNameGenerator(shape.Name);

            if (exportOptions == ShapeExportOptions.OneShapeExportOnce)
            {
                exportedUrl = shapeExportDirectory + "\\" + qulifiedShapeName + ".png";
            }
            else
            {
                exportedUrl = shapeExportDirectory + "\\" + qulifiedShapeName + Utility.RandomNumber(0, 999999, count++) + ".png";
            }


            if (!File.Exists(exportedUrl))
            {
                shape.Export(exportedUrl, PpShapeFormat.ppShapeFormatPNG, slideWidth * 4, slideHeight * 4, PpExportMode.ppClipRelativeToSlide);
            }

            //Back rotation to original
            shape.Rotation = originalRotation;

            actualUrl   = exportedUrl;
            exportedUrl = exportedUrl.Replace("\\", "/");

            imgurlLarge  = exportedUrl.Replace(PowerPointStudioRibbon.currentPPTPath.Replace("\\", "/"), "https://ezilmdev.org");
            imgurlMedium = exportedUrl.Replace(PowerPointStudioRibbon.currentPPTPath.Replace("\\", "/"), "https://ezilmdev.org");
            imgurlSmall  = exportedUrl.Replace(PowerPointStudioRibbon.currentPPTPath.Replace("\\", "/"), "https://ezilmdev.org");

            css = new ezCss(shape);

            //Custom dpi based on settings
            int    dpiRequired = Settings.exportImageDpi;
            Bitmap shapeBitmap = new Bitmap(exportedUrl);

            Utility.CustomDpi(shapeBitmap, shapeBitmap.Width, shapeBitmap.Height, dpiRequired, exportedUrl);
        }