> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IDrawContext

> Draw on station windows with the IDrawContext scripting object in ABBYY FlexiCapture: paint lines, rectangles, and pixels with RGB colors and transparency.

## What it does

Represents the context of drawing. Allows you to draw elementary geometric objects by using scripts. The color is specified as a sequence of four bytes: 0x00BBGGRR, where the "BB" bite represents the blue color, the "GG" bite is the green color and the "RR" bite is the green color.

## Methods

| **Definition**                                                                                                                                       | **Description**                                                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| FillAlphaRect( rect : [IShellRect](/flexi-capture/appendix/scripts-shell/i-shell-rect), rgbColor : int, alpha : int )                                | Draws a filled rectangle with a specified level of transparency.                                                   |
| FillRect( rect : [IShellRect](/flexi-capture/appendix/scripts-shell/i-shell-rect), rgbColor : int )                                                  | Draws a filled rectangle of the specified color.                                                                   |
| GetPixel( x : int, y : int ) : int                                                                                                                   | Retrieves the pixel color (in RGB) by its coordinates.                                                             |
| Line( start : [IPoint](/flexi-capture/appendix/scripts-shell/ipoint), end : [IPoint](/flexi-capture/appendix/scripts-shell/ipoint), rgbColor : int ) | Draws a line of the specified color connecting the "start" and "end" points.                                       |
| Rect( rect : [IShellRect](/flexi-capture/appendix/scripts-shell/i-shell-rect), rgbColor : int )                                                      | Draws a rectangle with a frame of the specified color.                                                             |
| SetPixel( x : int, y : int, rgbColor : int ) : int                                                                                                   | Sets the color (in RGB) of the pixel with specified coordinates. Returns the previous color of the pixel (in RGB). |

## Properties

| Name   | Type | Access    | Description                     |
| ------ | ---- | --------- | ------------------------------- |
| Handle | int  | Read-only | The handle to the context (HDC) |
