public property let Pixel(ByVal lX,ByVal lY,lValue) Dim sTemp Dim lOffset
lX = int(lX) lY = int(lY) lValue = int(lValue)
lOffset = lWidth * (lY - 1)
if lX <= lWidth and lY <= lHeight and lX > 0 and lY > 0 then ' Clipping ' Set the pixel value at this point sImage = LeftB(sImage,lOffset + (lX - 1)) & ChrB(lValue) & RightB(sImage,LenB(sImage) - (lOffset + lX)) end if end property
' Read only width and height, to change these, resize the image public property get Width() Width = lWidth end property
public property get Height() Height = lHeight end property
public sub Replace(ByVal lOldColour,ByVal lNewColour) Dim lTempX Dim lTempY
for lTempy = 1 to lHeight for lTempX = 1 to lWidth if Pixel(lTempX,lTempY) = lOldColour then Pixel(lTempX,lTempY) = lNewColour end if next next end sub
' Copy a section of the picture from one location to the other public sub Copy(ByVal lX1,ByVal lY1,ByVal lX2,ByVal lY2,ByVal lX3,ByVal lY3) Dim sCopy Dim lTemp1 Dim lTemp2 Dim lStartX Dim lStartY Dim lFinishX Dim lFinishY Dim lWidth Dim lHeight
if lX1 > lX2 then lStartX = lX2 lFinishX = lX1 else lStartX = lX1 lFinishX = lX2 end if