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

Changes the pixel values contained into an area of a GdPicture image from an array which contains Integer ARBG color values.

C#
public GdPictureStatus SetPixelArrayInteger(
    int ImageID, 
    ref int arPixels, 
    int DstLeft, 
    int DstTop, 
    int Width, 
    int Height
);
Visual Basic
Public Function SetPixelArrayInteger(
    ByVal ImageID As Integer, 
    ByRef arPixels() As Integer, 
    ByVal DstLeft As Integer, 
    ByVal DstTop As Integer, 
    ByVal Width As Integer, 
    ByVal Height As Integer
) As GdPictureStatus
Parameters
Parameters 
Description 
ImageID 
GdPicture Image Identifier.  
arPixels 
Array of pixel data.  
DstLeft 
The left destination pixel of the area.  
DstTop 
The top destination pixel of the area.  
Width 
The width of the destination area in pixel.  
Height 
The height of the destination 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.