コード例 #1
0
ファイル: BitmapCreation.cs プロジェクト: osorensen/PurplePen
        // Create a single PDF file
        void CreateOneBitmap(string fileName, CourseDesignator courseDesignator)
        {
            RectangleF mapRectangle = controller.GetCurrentPrintAreaRectangle(courseDesignator);

            // Get the course view for the course we are printing.
            CourseView courseView = CourseView.CreatePrintingCourseView(eventDB, courseDesignator);

            // Get the correct purple color to print the course in.
            short ocadId;
            float purpleC, purpleM, purpleY, purpleK;
            bool  purpleOverprint;

            FindPurple.GetPurpleColor(mapDisplay, appearance, out ocadId, out purpleC, out purpleM, out purpleY, out purpleK, out purpleOverprint);

            // Create a course layout from the view.
            CourseLayout layout = new CourseLayout();

            layout.SetLayerColor(CourseLayer.Descriptions, NormalCourseAppearance.blackColorOcadId, NormalCourseAppearance.blackColorName, NormalCourseAppearance.blackColorC, NormalCourseAppearance.blackColorM, NormalCourseAppearance.blackColorY, NormalCourseAppearance.blackColorK, false);
            layout.SetLayerColor(CourseLayer.MainCourse, ocadId, NormalCourseAppearance.courseColorName, purpleC, purpleM, purpleY, purpleK, purpleOverprint);
            CourseFormatter.FormatCourseToLayout(symbolDB, courseView, appearance, layout, CourseLayer.MainCourse);

            // Set the course layout into the map display
            mapDisplay.SetCourse(layout);
            mapDisplay.SetPrintArea(null);

            ExportBitmap exportBitmap = new ExportBitmap(mapDisplay);

            exportBitmap.CreateBitmap(fileName, mapRectangle, GetImageFormat(), bitmapCreationSettings.Dpi,
                                      bitmapCreationSettings.WorldFile ? mapDisplay.CoordinateMapper : null);
        }
コード例 #2
0
        public void ExportGif(string gifFileName)
        {
            // Get the area to export.
            RectangleF mapArea = GetAllCourseAreas();

            // Export the GIF file.
            ExportBitmap exportBitmap = new ExportBitmap(mapDisplay);
            exportBitmap.CreateBitmapAutoDpi(gifFileName, mapArea, ImageFormat.Gif, MAXPIXELWITH, MINDPI, MAXDPI);
        }
コード例 #3
0
        public void ExportGif(string gifFileName)
        {
            // Get the area to export.
            RectangleF mapArea = GetAllPrintAreas();

            // Export the GIF file.
            ExportBitmap exportBitmap = new ExportBitmap(mapDisplay);

            exportBitmap.CreateBitmapAutoDpi(gifFileName, mapArea, ImageFormat.Gif, MAXPIXELWITH, MINDPI, MAXDPI, mapDisplay.CoordinateMapper);
        }