VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging Namespace / VintasoftImage Class / GetAsBitmap Method / GetAsBitmap(EventHandler<ProgressEventArgs>) Method
Example



In This Topic
    GetAsBitmap(EventHandler<ProgressEventArgs>) Method
    In This Topic
    Returns the System.Drawing.Image object associated with this VintasoftImage object.
    Syntax
    'Declaration
     
    Public Overloads Function GetAsBitmap( _
       ByVal loadingProgress As EventHandler(Of ProgressEventArgs) _
    ) As Bitmap

    Parameters

    loadingProgress

    Return Value

    Exceptions
    ExceptionDescription
    Thrown if image is locked.
    Example
    This example shows how to load image from disk, copy image to clipboard, process image in external image editor, copy image back from the clipboard and save processed image.
    ' load image from file
    Using image As New Vintasoft.Imaging.VintasoftImage("c:\original-image.tif")
    	' copy image to clipboard
    	System.Windows.Forms.Clipboard.SetImage(image.GetAsBitmap())
                
    	' process image in external image editor and place it back to the clipboard
    	' ...
                
    	' get image from the clipboard
    	image.SetImage(New Vintasoft.Imaging.VintasoftImage(System.Windows.Forms.Clipboard.GetImage(), True))
                
    	' save image to the file
    	image.Save("c:\processed-image.jpg")
    End Using
    // load image from file
    using (Vintasoft.Imaging.VintasoftImage image =
        new Vintasoft.Imaging.VintasoftImage(@"c:\original-image.tif"))
    {
        // copy image to clipboard
        System.Windows.Forms.Clipboard.SetImage(image.GetAsBitmap());
                
        // process image in external image editor and place it back to the clipboard
        // ...
                
        // get image from the clipboard
        image.SetImage(new Vintasoft.Imaging.VintasoftImage(
            System.Windows.Forms.Clipboard.GetImage(), true));
                
        // save image to the file
        image.Save(@"c:\processed-image.jpg");
    }
    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also