Contrast

The Contrast method adjusts contrast of image or image area: it makes image more or less contrasting.

Contrast vLevel[, vControlPoint][, vX][, xY][, vWidth][, vHeight]

Parameters

vLevel
Specifies effect volume. Positive values increase contrast. Negative ones decrease contrast. Valid values range is from -100 to 100.

vControlPoint
Optional. Specifies grayscale control point. As a rule, pixels of this color are located in the most valuable part of image. Valid values are 0 - 255. Default value is 0 (black).

vX
Optional. Specifies left coordinate of contrast area on the imagespace. Default value is 0.

vY
Optional. Specifies top coordinate of contrast area on the imagespace. Default value is 0.

vWidth
Optional. Specifies width of contrast area on the imagespace. Default value is imagespace width.

vHeight
Optional. Specifies height of contrast area on the imagespace. Default value is imagespace height.

Example

Set g = CreateObject("shotgraph.image")
file_name = "c:\files\image.jpg"
g.GetFileDimensions file_name,xsize,ysize
g.CreateImage xsize,ysize,256
g.ReadImage file_name,palette,0,0
g.Contrast 30
g.JpegImage 95,0,"c:\newimage.gif"