Using GdPicture.NET in WPF application

Example requests & Code samples for GdPicture Toolkits.
Post Reply
User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Using GdPicture.NET in WPF application

Post by Loïc » Tue Jul 12, 2011 6:25 pm

Here an example that converts a GdPicture image to a BitmapSource object, and uses the JpegBitmapEncoder to subsequently save the BitmapSource to a jpegfile.

Feel free to post any comment, questions about the snippet or request for other scenario support.

Also, you can find a WPF application demo based on GdPicture8 that demonstrate how to use GdPictureImaging & GdViewer class in a WPF windows.

Code: Select all

        Dim oGdPictureImaging As New GdPicture.GdPictureImaging

        oGdPictureImaging.SetLicenseNumber("XXX") 'Please replace XXX by a valid license KEY
        Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("")
        If ImageID <> 0 Then
            oGdPictureImaging.ConvertTo24BppRGB(ImageID)
            Dim MyBitmapSource As BitmapSource = System.Windows.Media.Imaging.BitmapSource.Create(oGdPictureImaging.GetWidth(ImageID), _
                                                                                                  oGdPictureImaging.GetHeight(ImageID), _
                                                                                                   oGdPictureImaging.GetHorizontalResolution(ImageID), _
                                                                                                   oGdPictureImaging.GetVerticalResolution(ImageID), _
                                                                                                   PixelFormats.Bgr24, _
                                                                                                   Nothing, _
                                                                                                   oGdPictureImaging.GetBits(ImageID), _
                                                                                                   oGdPictureImaging.GetStride(ImageID) * oGdPictureImaging.GetHeight(ImageID), _
                                                                                                   oGdPictureImaging.GetStride(ImageID))
            oGdPictureImaging.ReleaseGdPictureImage(ImageID)
            Dim MyEncoder As New JpegBitmapEncoder()
            MyEncoder.Frames.Add(BitmapFrame.Create(MyBitmapSource))
            Dim MyFileStream As New System.IO.FileStream("c:\test.jpg", System.IO.FileMode.Create)

            MyEncoder.Save(MyFileStream)
            MyFileStream.Close()
Attachments
wpf-demo.zip
GdPicture.NET in WPF demo
(11.08 KiB) Downloaded 843 times

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

WPF Sample

Post by Loïc » Tue Jul 12, 2011 6:47 pm


matze
Posts: 1
Joined: Sun Feb 12, 2012 10:02 am

Re: Using GdPicture.NET in WPF application

Post by matze » Mon Feb 13, 2012 3:40 pm

Hi,
the link for the demo doesn't work.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Using GdPicture.NET in WPF application

Post by Loïc » Mon Feb 13, 2012 3:45 pm

Hello,

Fixed. Please try again.

Kind regards,

Loïc

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: Using GdPicture.NET in WPF application

Post by Gabriela » Thu Jan 31, 2019 4:51 pm

Hello,

You can find WPF demo samples in the installation package of the toolkit under \\Samples\\WPF.

alphayash
Posts: 1
Joined: Wed Aug 03, 2022 3:02 pm

Re: Using GdPicture.NET in WPF application

Post by alphayash » Wed Aug 03, 2022 3:04 pm

was looking for this thread for a long time now :)
VidMate Cinevez technomantu

golu121
Posts: 1
Joined: Thu Dec 22, 2022 10:02 am

Re: Using GdPicture.NET in WPF application

Post by golu121 » Thu Dec 22, 2022 10:05 am

I just Looking here :D :roll:
GBwhatsapp

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest