GdPicture.NET Reference Guide
SetPixelArrayByte8bpp Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : SetPixelArrayByte8bpp Method
GdPicture Image Identifier.
Array of pixel indexes. each entry of the array is a reference to a palette index [0 - 255].
The left destination pixel of the area.
The top destination pixel of the area.
The width of the area in pixel.
The height of the area in pixel.
Set pixel indexes from an array of bytes to an area of a paletized 8bpp GdPicture image.
Syntax
'Declaration
 
Public Function SetPixelArrayByte8bpp( _
   ByVal ImageID As Integer, _
   ByVal Data() As Byte, _
   ByVal DstLeft As Integer, _
   ByVal DstTop As Integer, _
   ByVal Width As Integer, _
   ByVal Height As Integer _
) As GdPictureStatus
public GdPictureStatus SetPixelArrayByte8bpp( 
   int ImageID,
   byte[] Data,
   int DstLeft,
   int DstTop,
   int Width,
   int Height
)
public function SetPixelArrayByte8bpp( 
    ImageID: Integer;
    Data: Bytearray of;
    DstLeft: Integer;
    DstTop: Integer;
    Width: Integer;
    Height: Integer
): GdPictureStatus; 
public function SetPixelArrayByte8bpp( 
   ImageID : int,
   Data : byte[],
   DstLeft : int,
   DstTop : int,
   Width : int,
   Height : int
) : GdPictureStatus;
public: GdPictureStatus SetPixelArrayByte8bpp( 
   int ImageID,
   byte[]* Data,
   int DstLeft,
   int DstTop,
   int Width,
   int Height
) 
public:
GdPictureStatus SetPixelArrayByte8bpp( 
   int ImageID,
   array<byte>^ Data,
   int DstLeft,
   int DstTop,
   int Width,
   int Height
) 

Parameters

ImageID
GdPicture Image Identifier.
Data
Array of pixel indexes. each entry of the array is a reference to a palette index [0 - 255].
DstLeft
The left destination pixel of the area.
DstTop
The top destination pixel of the area.
Width
The width of the area in pixel.
Height
The height of the area in pixel.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method works only with 8bpp image.
Example
Usage of GetPixelArrayByte8bpp() and SetPixelArrayByte8bpp() methods to apply negative effect on a 8bpp grayscale GdPicture image.
Dim oGdPictureImaging As New GdPictureImaging
Dim arPixel() As Byte
Dim X As Integer
Dim Y As Integer
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("8bppimage.tif")
If oGdPictureImaging.GetBitDepth(ImageID) = 8 Then
   Dim ImageHeight As Integer = oGdPictureImaging.GetHeight(ImageID)
   Dim ImageWidth As Integer = oGdPictureImaging.GetWidth(ImageID)
   ReDim arPixel(ImageWidth * ImageHeight)
   oGdPictureImaging.GetPixelArrayByte8bpp(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.SetPixelArrayByte8bpp(ImageID, arPixel, 0, 0, ImageWidth, ImageHeight)
   oGdPictureImaging.SaveAsTIFF(ImageID, "8bppimageneg.tif", TiffCompression.TiffCompressionAUTO)
End If
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
SetPixelArrayByte8bpp Method