GetPixelArrayBytesRGB Method

See Also     Examples     Applies To

Stores into a 1D array of byte each Blue, Green and Red components of the pixel of an area of the native GdPicture image.

Syntax

object.GetPixelArrayBytesRGB (*arPixels(), nSrcLeft, nSrcTop, nWidth, nHeight)

The GetPixelArrayBytesRGB syntax has these parts:

Part Description
object Required. An object expression that evaluates to an object in the Applies To list.
*arPixels() Required. Output 1D (0 based) Byte Array. pixel data.
nSrcLeft Required. Long. The left source pixel of the area.
nSrcTop Required. Long. The top source pixel of the area.
nWidth Required. Long. The width of the area in pixel.
nHeight Required. Long. The height of the area in pixel.

Returns

Long. GdPictureStatus

Category

Pixel Access Functions

Visual Basic Sample

usage of SetPixelArrayBytesRGB() and GetPixelArrayBytesRGB() functions to apply negative effect on the native GdPicture image


Dim arPixel() As Byte
Dim X As Long
Dim Y As Long

Call object.GetPixelArrayBytesRGB(arPixel, 0, 0, object.GetWidth, object.GetHeight)

For X = 0 To object.GetWidth - 1
    For Y = 0 To object.GetHeight - 1
        arPixel((Y * 3 * object.GetWidth) + X * 3) = Not arPixel((Y * 3 * object.GetWidth) + X * 3)  'Blue channel
        arPixel((Y * 3 * object.GetWidth) + X * 3 + 1) = Not arPixel((Y * 3 * object.GetWidth) + X * 3 + 1)  'Green channel
        arPixel((Y * 3 * object.GetWidth) + X * 3 + 2) = Not arPixel((Y * 3 * object.GetWidth) + X * 3 + 2)  'Red channel
    Next Y
Next X
Call object.SetPixelArrayBytesRGB(arPixel, 0, 0, object.GetWidth, object.GetHeight)






© Copyright 2008 GdPicture All rights reserved.
Documentation MAP.