# Quick Start

Learn some basic concepts of DsImaging like creating, saving, loading, and modifying images.

## Content

The following quick start sections help you in getting started with the DsImaging library:

* [Create and Save an Image](/document-solutions/dot-net-imaging-api/docs/online/GettingStarted/quickstart#create-and-save-an-image)
* [Load and Modify an Image](/document-solutions/dot-net-imaging-api/docs/online/GettingStarted/quickstart#load-and-modify-an-image)

## Create and Save an Image

This quick start covers how to create an image and draw string on it in a specified font using a .NET Core or .NET Standard application. Follow the steps below to get started:

1. [Create an instance of GcBitmap class](/document-solutions/dot-net-imaging-api/docs/online/GettingStarted/quickstart#step-1-create-an-instance-of-gcbitmap-class)
2. [Draw and fill a rectangle](/document-solutions/dot-net-imaging-api/docs/online/GettingStarted/quickstart#step-2-draw-and-fill-a-rectangle)
3. [Save the image](/document-solutions/dot-net-imaging-api/docs/online/GettingStarted/quickstart#step-3-save-the-image)

![Image with 'Hello World' text created in GcImaging](https://cdn.mescius.io/document-site-files/images/a5680f0e-2d32-45dc-8048-d3ef11d0dae7/images/gcimage.png)

### Step 1: Create an instance of GcBitmap class

1. Create a new application (.NET Core Console App\\Windows Forms App) and add the references.
2. Include the following namespaces
    1. using GrapeCity.Documents.Imaging;
3. Create a new image using an instance of [GcBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.html) class, through code.

    ```csharp
    //Create GcBitmap
    var bmp = new GcBitmap(1024, 1024, true, 96, 96);
    //Create a graphics for drawing
    GcBitmapGraphics g = bmp.CreateGraphics();
    ```

### Step 2: Draw and fill a rectangle

Add the following code to draw a rectangle using the **RectangleF** class, and then add text to it using the [DrawString](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Drawing.GcGraphics.DrawString.html) method of [GcBitmapGraphics](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html) class.

```csharp
//Add a radial gradient
RadialGradientBrush r= new RadialGradientBrush(Color.Beige, 
        Color.RosyBrown, new PointF(0.5f, 0.5f), true);

//Draw a rectangle
var rc = new RectangleF(0, 0, bmp.Width, bmp.Height);

//Fill the rectangle using specified brush
g.FillRectangle(rc, r);

// Create a text format for the "Hello World!" string:
TextFormat tf = new TextFormat();
            
//Pick a font size, color and style
tf.FontSize = 80;
tf.FontStyle = FontStyle.BoldItalic;
tf.ForeColor = Color.Chocolate;

//Draw the string (text)
g.DrawString("Hello World!", tf, rc, TextAlignment.Center, 
        ParagraphAlignment.Center, false);
```

### Step 3: Save the image

Save the image using [SaveAsJpeg](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.SaveAsJpeg.html) method of the [GcBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.html) class.

```csharp
//Save bitmap as JPEG image
bmp.SaveAsJpeg("HelloWorld.jpg");
```

## Load and Modify an Image

This quick start covers how to load an existing image, modify and save it using a .NET Core or .NET Standard application. Follow the steps below to get started:

1. [Load an existing image](/document-solutions/dot-net-imaging-api/docs/online/GettingStarted/quickstart#step-1-load-an-existing-image)
2. [Modify the image](/document-solutions/dot-net-imaging-api/docs/online/GettingStarted/quickstart#step-2-modify-the-image)
3. [Save the image](/document-solutions/dot-net-imaging-api/docs/online/GettingStarted/quickstart#step-3-save-the-image)

### Step 1: Load an existing image

1. Create a new application (.NET Core Console App\\Windows Forms App) and add the references.
2. Include the following namespace
    1. using GrapeCity.Documents.Imaging;
3. Load an existing image using [Load](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.Load.html) method of the [GcBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.html) class.

    ```csharp
    //Create GcBitmap
    var bmp = new GcBitmap();
    var fs = new FileStream(Path.Combine("puffins-small.jpg"), FileMode.Open, FileAccess.ReadWrite);
    //Load image
    bmp.Load(fs);
    ```

### Step 2: Modify the image

1. Add the following code that to add a text using the [DrawString](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Drawing.GcGraphics.DrawString.html) method of [GcBitmapGraphics](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmapGraphics.html) class to draw string.

    ```csharp
    //Create a graphics for drawing
    GcBitmapGraphics g = bmp.CreateGraphics();
    
    // Create a text format for the string:
    TextFormat tf = new TextFormat();
    
    // Pick a font size, color and style
    tf.FontSize = 10;
    tf.ForeColor = Color.Red;
    tf.FontStyle = FontStyle.BoldItalic;
    
    //Draw the string (text)
    g.DrawString("Penguins", tf, new PointF(10, 10));
    ```

### Step 3: Save the image

Save the image using [SaveAsJpeg](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.SaveAsJpeg.html) method of the [GcBitmap](/document-solutions/dot-net-imaging-api/api/online/DS.Documents.Imaging/GrapeCity.Documents.Imaging.GcBitmap.html) class.

```csharp
//Save bitmap
bmp.SaveAsJpeg("NewImage.jpg");
```