# Editor.Pixmap

A pixel map, or just a simple image.

- Kind: class
- Namespace: `Editor`
- Assembly: `Sandbox.Tools`

## Constructors

- [`Pixmap`](/api/Editor.Pixmap/.ctor): Create a new empty pixel map. It can then be drawn to via the [Editor.Paint](/api/Editor.Paint) class, like so: ```csharp var myPixMap = new Pixmap( 16, 16 ); Paint.Target( myPixMap ); Paint.Antialiasing = true; Paint.ClearPen(); Paint.SetBrush( Color.Red ); Paint.DrawRect( new Rect( 0, myPixMap.Size ), 2 ); Paint.Target( null ); ```

## Properties

- [`HasAlpha`](/api/Editor.Pixmap/HasAlpha): Whether this pixel map supports the alpha channel.
- [`Height`](/api/Editor.Pixmap/Height): Height of the pixel map.
- [`Size`](/api/Editor.Pixmap/Size): THe size of this pixel map.
- [`Width`](/api/Editor.Pixmap/Width): Width of the pixel map.

## Methods

- [`Clear`](/api/Editor.Pixmap/Clear): Fill the pixel map with given color.
- [`FromBitmap`](/api/Editor.Pixmap/FromBitmap): Create a pixmap from a bitmap
- [`FromFile`](/api/Editor.Pixmap/FromFile): Load an image from a file on disk, specifically from "core/tools/images".
- [`FromTexture`](/api/Editor.Pixmap/FromTexture): Create a pixmap from a texture.
- [`GetBmp`](/api/Editor.Pixmap/GetBmp): Returns the raw bytes of a BMP file that contains this pixel maps image. Internally writes and deletes a file, so be careful using it often.
- [`GetJpeg`](/api/Editor.Pixmap/GetJpeg): Returns the raw bytes of a JPEG file that contains this pixel maps image. Internally writes and deletes a file, so be careful using it often.
- [`GetPixel`](/api/Editor.Pixmap/GetPixel)
- [`GetPng`](/api/Editor.Pixmap/GetPng): Returns the raw bytes of a PNG file that contains this pixel maps image. Internally writes and deletes a file, so be careful using it often.
- [`Resize`](/api/Editor.Pixmap/Resize): Returns a new pixel map that contains resized version of this image with given dimensions. Will try to preserve aspect ratio.
- [`SaveJpg`](/api/Editor.Pixmap/SaveJpg): Save the pixel map as a JPEG file at given location.
- [`SavePng`](/api/Editor.Pixmap/SavePng): Save the pixel map as a PNG file at given location.
- [`Scroll`](/api/Editor.Pixmap/Scroll): Duplicate a sub-rectangle of the image at re-draw it at given coordinates.
- [`UpdateFromPixels`](/api/Editor.Pixmap/UpdateFromPixels)
