1. Installation
On development computer you need to install the complete GdPicture.NET package running the gdpicturedotnet.exe installer.
The GdPicture.NET suite should be installed into C:\Program Files\GdPicture.NET\
After installation, we recommend you to have a look on the samples directory to get some featured examples of the GdPicture.NET usage.
The GdPicture.NET suite includes 2 classes: GdPictureImaging & GdViewer. See below how to instantiate objects from these classes.
Notes:
2. Adding a reference to GdPicture.NET into your application.
3. Using a GdPictureImaging object into your application.
Before starting, make sure you successfully done first & second steps.
The GdPictureImaging class is a non-visual class. Therefore you have to instantiate a GdPictureImaging object by code.
Each GdPictureImaging object must be unlocked using the SetLicenseNumber() method.
private void button1_Click(object sender, EventArgs e)
{
GdPictureImaging oGdPictureImaging = new GdPictureImaging();
oGdPictureImaging.SetLicenseNumber("YOUR_LICENSE_KEY");
int ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("c:\\test.jpg");
oGdPictureImaging.SaveAsJP2(ImageID, "c:\\test.jp2",64);
oGdPictureImaging.ReleaseGdPictureImage(ImageID);
}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim oGdPictureImaging As New GdPictureImaging
oGdPictureImaging.SetLicenseNumber("YOUR_LICENSE_KEY")
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("c:\test.jpg")
oGdPictureImaging.SaveAsJP2(ImageID, "c:\test.jp2", 64)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
End Sub
4. Using a GdViewer object into your application.
Before starting, make sure you successfully done first & second steps.
The GdViewer class is a visual class. Therefore you can instantiate a GdViewer object by code or simply dragging a GdViewer item from the Visual Studio Toolbox to your Windows Form:
Each GdViewer object must be unlocked using the SetLicenseNumber() method.
private void button1_Click(object sender, EventArgs e)
{
this.gdViewer1.SetLicenseNumber("YOUR_LICENSE_KEY");
this.gdViewer1.DisplayFromFile("c:\\test.jpg");
}
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.GdViewer1.SetLicenseNumber("YOUR_LICENSE_KEY")
Me.GdViewer1.DisplayFromFile("c:\test.jpg")
End Sub
5. Displaying a GdPicture Image handled by a GdPictureImaging object to a GdViewer object.
The GdPictureImaging class can create GdPicture Image from file, memory RAW, scanner...
If you want to display in real time a GdPicture Image handled by a GdPictureImaging object you can use the DisplayFromGdPictureImage method of the GdViewer class.
VB.NET example:
This example assumes you already have a GdPictureImaging object named oGdPictureImaging and a GdViewer object drawn on your form named GdViewer1.
Dim ImageID As Integer = oGdPictureImaging.CreateImageFromFile("c:\test.jpg")
GdViewer1.DisplayFromGdPictureImage(ImageID)
If later in your code, you want to draw something on the image (like text) and display the modification without reloading the image you can do:
oGdPictureImaging.DrawText(ImageID, "hello World!", 50, 50, 10, FontStyle.FontStyleBold, Color.Red, "Arial", True)
GdViewer1.Refresh()
|
What do you think about this topic? Send feedback!
|
|
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.
|