You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > Pixel Access > GetPixelArrayInteger Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.GetPixelArrayInteger Method

Stores into an array of Integer the ARGB pixel values of an area of a GdPicture image.

C#
public GdPictureStatus GetPixelArrayInteger(
    int ImageID, 
    ref int arPixels, 
    int SrcLeft, 
    int SrcTop, 
    int Width, 
    int Height
);
Visual Basic
Public Function GetPixelArrayInteger(
    ByVal ImageID As Integer, 
    ByRef arPixels() As Integer, 
    ByVal SrcLeft As Integer, 
    ByVal SrcTop As Integer, 
    ByVal Width As Integer, 
    ByVal Height As Integer
) As GdPictureStatus
Parameters
Parameters 
Description 
ImageID 
GdPicture Image Identifier.  
arPixels 
Output parameter. Array of pixel data.  
SrcLeft 
The left source pixel of the area.  
SrcTop 
The top source pixel of the area.  
Width 
The width of the area in pixel.  
Height 
The height of the area in pixel.  
Returns

A member of the GdPictureStatus enumeration.

usage of GetPixelArrayInteger() and SetPixelArrayInteger() functions to apply negative effect on a GdPicture image

Dim oGdPictureImaging As New GdPictureImaging
 
Dim arPixel() As Integer
Dim X As Integer
Dim Y As Integer
Dim ImageID As Integer
Dim ImageHeight As Integer
Dim ImageWidth As Integer
 
oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by a demo or commercial license key
ImageID = oGdPictureImaging.CreateGdPictureImageFromFile("image.tif")
ImageHeight = oGdPictureImaging.GetHeight(ImageID)
ImageWidth = oGdPictureImaging.GetWidth(ImageID)
 
ReDim arPixel(ImageWidth * ImageHeight)
oGdPictureImaging.GetPixelArrayInteger(ImageID, arPixel, 0, 0, ImageWidth, ImageHeight)
 
For X = 0 To ImageWidth - 1
    For Y = 0 To ImageHeight - 1
        arPixel((Y * ImageWidth) + X) = Not arPixel((Y * ImageWidth) + X)
    Next Y
Next X
oGdPictureImaging.SetPixelArrayInteger(ImageID, arPixel, 0, 0, ImageWidth, ImageHeight)
oGdPictureImaging.SaveAsTIFF(ImageID, "imageneg.tif", TiffCompression.TiffCompressionAUTO)
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.