The EndDibAccess method is used to allow access to pixels in the Device Independent Bitmap (DIB). This method is to be used in conjunction with the StartDibAccess method.
[Visual Basic]   [ Boolean = ]imagekitcontrolname.Effect.EndDibAccess(DibNo As Integer)
[Visual C++]     [ BOOL = ]imagekitcontrolname.GetEffect().EndDibAccess(short DibNo)
[VB.NET]   [ Boolean = ]imagekitcontrolname.Effect.EndDibAccess(DibNo As Short)
[C#.NET]   [ bool = ]imagekitcontrolname.Effect.EndDibAccess(short DibNo)

Parameters

Name Explanation
DibNo The identification number of the DIB as retrieved from the StartDibAccess method.

Return Value

Returns True (nonzero) if successful, otherwise returns False (0).

Explanation

The EndDibAccess method is to be used in conjunction with the StartDibAccess method. The DibNo parameter value must be the same as that retrieved from the StartDibAccess method.

To access the DIB and manipulate pixel data, you must use the following methods as a group:
StartDibAccess
      |
GetDibPixel, SetDibPixel
      |
EndDibAccess

Note: If you want to access the DIB it is highly recommended that you use the ImageKit DLL functions. They are much faster than the ImageKit OCX controls at accessing the DIB. However, since you can also use the OCX controls to access the DIB, the explanation is included.

Sample Code
The following code starts access to the DIB, then loops through each pixel in the image, using the GetDibPixel method to retrieve the pixels' rgb values. Then those values are reversed and set using the SetDibPixel method. (For 1, 16, 24, or 32 bit images)

Visual Basic

   Dim Ret As Boolean
   Dim DibNo As Integer
   Dim i As Long, j As Long
   Dim PalNo As Integer, Red As Integer, Green As Integer, Blue As Integer

   Ret = ImageKit1.GetImageType
   If Ret = False Then Exit Sub
   Ret = ImageKit1.Effect.StartDibAccess(ImageKit1.ImageHandle, DibNo)
   If Ret = False Then Exit Sub

   For i = 0 To ImageKit1.ImageHeight - 1
      For j = 0 To ImageKit1.ImageWidth - 1
         Ret = ImageKit1.Effect.GetDibPixel(DibNo, j, i, PalNo, Red, Green, Blue)
         If ImageKit1.BitCount = 1 Then
            If PalNo <> 0 Then
               PalNo = 0
            Else
               PalNo = 1
            End If
         Else If ImageKit1.BitCount > 8 Then
            Blue = 255 - Blue
            Green = 255 - Green
            Red = 255 - Red
         End If
         Ret = ImageKit1.Effect.SetDibPixel(DibNo, j, i, PalNo, Red, Green, Blue)
      Next j
   Next i
   Ret = ImageKit1.Effect.EndDibAccess(DibNo)
   ImageKit1.Refresh

The ImageKit10 ActiveX is a product created by Newtone Corporation