|
After you download PhotoController, you could double click the install.bat
to execute the installation. That will copy the core file IC.PhotoController.dll
( angGoGo.PhotoController.dll for v1.x )
to your computer Global Assembly Cache Folder. It could be "C:\WINDOWS\assembly".
When you want to use this assembly, add the reference of PhotoController in your project
and include the namespace like below:
Working with PhotoController v2.x
In version 2.x, the namespace has been changed to "IC.PhotoController" instead of the previous "angGoGo.PhotoController".
So you must include the correct namespace as follows when using the new version.
[VB.NET]
Imports
IC.PhotoController
Imports
IC.PhotoController.Filter
[C#]
using
IC.PhotoController;
using
IC.PhotoController.Filter;
|
Delcare the instance of PhotoController as follows
[VB.NET]
Dim objpc As IC.PhotoController.Controller
objpc
= New IC.PhotoController.Controller
[C#]
IC.PhotoController.Controller objpc = new
Controller();
|
For more sample code about how to use other methods in PhotoController v2.0, such as Filter, please read [Tutorial]
section in the documentation.
Working with PhotoController v1.x
[VB.net]
Imports angGoGo.PhotoController
[C#]
using angGoGo.PhotoController;
You can initialize the object like below.
[VB.net]
Dim image As Image.FromFile("test.jpg")
Dim objPC As New angGoGo.PhotoController.Controller( image )
[C#]
Image image = Image.FromFile("test.jpg");
angGoGo.PhotoController.Controller objPC = new Controller(image);
Now you can process this photo. The following code perform a color adjust on the
loaded image. And perform a sharpen effect on the original image.
[VB.net]
' Make grayscale color adjust
image = objPC.ColorAdjust(AdjustType.GrayScale)
image.Save('grayImage.jpg', 75)
' prepares structure for sharpen filter effect
Dim filter As New Filters(FilterStyle.Sharpen)
filter.Level = 5
' restore the original image firstly, because the loaded image
has been grayscaled
objPC.Reset()
' Sharpen the photo now
image = objPC.Filter(filter)
[C#]
// Make grayscale color adjust
image objPC.ColorAdjust(AdjustType.GrayScale);
image.Save('grayImage.jpg', 75);
// prepares structure for sharpen filter effect
Filters filter = new Filters(FilterStyle.Sharpen);
filter.Level = 5;
' restore the original image firstly, because the loaded image
has been grayscaled
objPC.Reset();
' Sharpen the photo now
image = objPC.Filter(filter);
The following code will save the photo to a file with quality value is 75
[VB.net]
objPC.Save("output_75.jpg", 75)
[C#]
objPC.Save("output_75.jpg", 75);
|