This class represents a frame of the JPEG format.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
Public NotInheritable Class JpegFrame _ Inherits Frame
public sealed class JpegFrame : Frame
You can use JpegWriter class instead of the Save(String, IEncoderOptions) method of the Bitmap. In particular it enables you to save the image asynchronously.
The JpegWriter class usage is demonstrated below:
Dim bitmap As New Aurigma.GraphicsMill.Bitmap("c:\Mountain.jpg") Dim writer As New Aurigma.GraphicsMill.Codecs.JpegWriter("C:\Mountain2.jpg") Dim frame As New Aurigma.GraphicsMill.Codecs.JpegFrame frame.Quality = 50 frame.IsProgressive = True frame.SetBitmap(bitmap) bitmap.Dispose() writer.AddFrame(frame) frame.Dispose() writer.Dispose()
using (Aurigma.GraphicsMill.Bitmap bitmap = new Aurigma.GraphicsMill.Bitmap(@"c:\Mountain.jpg")) { using (Aurigma.GraphicsMill.Codecs.JpegWriter writer = new Aurigma.GraphicsMill.Codecs.JpegWriter(@"C:\Mountain2.jpg")) { using (Aurigma.GraphicsMill.Codecs.JpegFrame frame = new Aurigma.GraphicsMill.Codecs.JpegFrame()) { frame.Quality = 50; frame.IsProgressive = true; frame.SetBitmap(bitmap); writer.AddFrame(frame); } } }