programming-examples/c-sharp/Others/Use JpegBitmapDecoder.cs
2019-11-15 12:59:38 +01:00

19 lines
527 B
C#

Use JpegBitmapDecoder
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Media.Imaging;
using System.IO;
class UseBitmapCodecs
{
static string GetCamera(string myJpegPath)
{
JpegBitmapDecoder decoder = new JpegBitmapDecoder(new Uri(myJpegPath),BitmapCreateOptions.None, BitmapCacheOption.None);
BitmapMetadata bmpData = (BitmapMetadata) decoder.Frames[0].Metadata;
return bmpData.CameraModel;
}
}