コード例 #1
0
 public void Encode <TPixel>(Image <TPixel> image, Stream stream)
     where TPixel : unmanaged, IPixel <TPixel>
 {
     using (System.Drawing.Bitmap sdBitmap = SystemDrawingBridge.To32bppArgbSystemDrawingBitmap(image))
     {
         sdBitmap.Save(stream, this.imageFormat);
     }
 }
コード例 #2
0
        public Task EncodeAsync <TPixel>(Image <TPixel> image, Stream stream, CancellationToken cancellationToken)
            where TPixel : unmanaged, IPixel <TPixel>
        {
            using (System.Drawing.Bitmap sdBitmap = SystemDrawingBridge.To32bppArgbSystemDrawingBitmap(image))
            {
                sdBitmap.Save(stream, this.imageFormat);
            }

            return(Task.CompletedTask);
        }