SaveBitmap() public static method

public static SaveBitmap ( Bitmap bitmap, string fileName, ImageFormat imageFormat ) : void
bitmap System.Drawing.Bitmap
fileName string
imageFormat System.Drawing.Imaging.ImageFormat
return void
コード例 #1
0
ファイル: MapDisplay.cs プロジェクト: JoblyFonty/PurplePen
        // For bitmap or PDF background, write the bitmap to the given file with the given format.
        public void WriteBitmapMap(string fileName, ImageFormat format, out float dpi)
        {
            dpi = this.bitmapDpi;
            Bitmap bmp = ((GDIPlus_Bitmap)bitmap).Bitmap;

            BitmapUtil.SaveBitmap(bmp, fileName, format);
        }
コード例 #2
0
        // Write all the image bitmaps. Also updates the file names in the templates to the full path names.
        private void WriteImageBitmaps(Map map)
        {
            using (map.Write()) {
                List <TemplateInfo> templates = new List <TemplateInfo>(map.Templates);

                foreach (BitmapToWrite bitmapToWrite in BitmapsToWrite())
                {
                    BitmapUtil.SaveBitmap(bitmapToWrite.Bitmap, bitmapToWrite.FullPath, bitmapToWrite.Format);

                    for (int i = 0; i < templates.Count; ++i)
                    {
                        if (templates[i].absoluteFileName == bitmapToWrite.Name)
                        {
                            templates[i] = templates[i].UpdateFileName(bitmapToWrite.FullPath);
                        }
                    }
                }

                map.Templates = templates;
            }
        }