Marblecore Imaging Library Documentation

Documentation Introduction

Getting started with the Class Library for .NET

The Marblecore Imaging Class Library is a .NET wrapper for the Marblecore Imaging Library. Using the Class Library you can implement Marblecore Imaging in your .NET enabled applications. You can use any .NET programming language you want, like C#, Visual Basic and J#. The library is very easy to use and well documented. This getting started page shows you how to implement the Class Library and start coding right away. If you don't want to use .NET, take a look at the ATL/COM version.

When to use

Use the .NET Class Library if you are building applications using .NET technology that needs advanced high quality image processing. You can build stunning web applications or create redistributable applications that takes advantage of the Marblecore Imaging Library. The component is fast enough to use it to draw realtime interface elements for GUI (Windows Forms) applications. Easy to use methods are available to convert Marblecore images to .NET images.

How to use

To implement the Marblecore Imaging Class Library follow these easy steps. It will add the Marblecore Class Library to your project (if you want to add the library to your GAC, scroll down for more information).
  • Download the Marblecore Imaging Class Library from the download page.
  • Extract the files to any location you like.
  • Add the Class Library to your .NET project. In Visual Studio this is done by selecting the 'References' node in the document tree at the left. Right click 'References' and choose 'Add reference'. Go to the 'Browse' tab and select the file MarblecoreImagingCL.dll. The library is now added to your project.
  • Include the Marblecore namespace in the appropriate source code files (where you want to use Marblecore Imaging) by adding the following code at the top section:
 
using Marblecore;
 
Marblecore Imaging is now ready to use. If you want to install the Class Library to your Global Assembly Cache (GAC) you can do that by executing the following command:
 
gacutil /i MarblecoreImagingCL.dll

Examples

The next step is to use Marblecore Imaging in your project. This is very easy by declaring a new Marblecore Imaging variable. The following example shows you how to create a new image and save it to a file:
 
1 // Create a new image class
2 MarblecoreImaging Imaging = new MarblecoreImaging();
3 
4 // Create a new image and draw a red rectangle on it
5 if (Imaging.Create(200, 200))
6 {
7     Imaging.DrawRectangleFilled(0, 0, 200, 200, Imaging.GetColorFromHTML("#ff0000"));
8 
9     // Save the file
10    Imaging.SaveFile("example.jpg");
11 }
 
If you want to use the image on the Marblecore Imaging canvas you have to convert it to a .NET Image using the SaveToHBitmap or SaveToHBitmapPreMultiplied methods. The following example show you how this is done. The example is the same as above, but now the image is saved to a .NET Image variable.
 
1 // Create a new image class
2 MarblecoreImaging Imaging = new MarblecoreImaging();
3 
4 // Create a new image and draw a red rectangle on it
5 if (Imaging.Create(200, 200))
6 {
7     Imaging.DrawRectangleFilled(0, 0, 200, 200, Imaging.GetColorFromHTML("#ff0000"));
8 
9     // Save to a .NET Image
10    Image DotNetImage = Image.FromHbitmap(Imaging.SaveToHBitmap());
11 }

Apply a license

If you have bought a Marblecore Imaging license, you need to supply your license data to confirm you are a licensed user. License verification is very simple and performed by adding the LicenseVerify method to your code. Take a look at the getting started with licenses page for more information.

Optimized for 64-bit systems

The Marblecore Imaging Library uses native code for the actual image processing to maximize the speed of the library and utilize the system resources as optimal as possible. If you are targeting your application for 64-bit deployment, you can use the 64-bit versions of the Class Library. These libraries maximizes the performance on 64-bit based systems. The following versions are included in the download package:
  • Standard 32-bit version (MarblecoreImagingCL.dll)
  • 64-bit optimized version (MarblecoreImagingCL.x64.dll)
  • Itanium 64-bit optimized version (MarblecoreImagingCL.ia64.dll)

Requirements

The latest version of the Microsoft Visual C++ Redistributable Package needs to be installed. If the Class Library does not work, please download the following update from the Microsoft download website:

Known issues

In some cases the Class Library will not work, because some files on your computer are outdated or unpatched. The library depends on these files and you need to install an update of the Microsoft Visual C++ Redistributable Package. See the requirements section for more information on where and how to download. For your convenience this update is already included in the Marblecore Imaging Class Library download package. After installation the library will work right away. Please install the right version for the system architecture you use (32-bit, 64-bit or Itanium 64-bit). If you use the normal 32-bit version of the Class Library on a 64-bit system, you need to install the 32-bit x86 package (vcredist_x86.exe). You can install different architecture versions of the redistributable package on the same system without any problems.

Redistributing software with Marblecore Imaging

If you have built a redistributable application which uses Marblecore Imaging you have to make sure the right license is applied. For redistributable applications the OEM license is necessary. Regarding the redistribution and installation of your application we suggest to add the Microsoft Visual C++ Redistributable Package as described above to your installation package. This is only necessary if you are distributing to client environments that don't match the prerequisites.

Examples

Windows Forms .NET Application (C#) | ASP.NET website example (C#) | ASP.NET website example (VB)

See also

Download | Buy license | Getting started with licenses | Getting started with the ATL/COM