Skip to content
On this page

Class: UniappImagePixelInformation ​

Classdesc

JavaScript gets image pixel information

Implements

ImagePixelInformationInterface

Classes

UniappImagePixelInformation

Param

grayscale threshold(default 100)

Hierarchy ​

  • ImagePixelInformation

    ↳ UniappImagePixelInformation

Constructors ​

constructor ​

• new UniappImagePixelInformation(grayThreshold)

Parameters ​

NameType
grayThresholdnumber

Overrides ​

ImagePixelInformation.constructor

Defined in ​

components/imagePixelInformation/index.ts:60

Properties ​

grayThreshold ​

• grayThreshold: number

@description: grayscale threshold(default 100)

Defined in ​

components/imagePixelInformation/index.ts:59

Methods ​

uniGetImageData ​

▸ uniGetImageData(canvasId, imageResource, width?, height?, callback): void

@description: Uniapp Get image pixel information(rgba)

Parameters ​

NameTypeDefault valueDescription
canvasIdstringundefinedcanvas id
imageResourcestringundefinedimage path
widthnumber256The width of the rectangle from which the pixel data will be retrieved;
heightnumber256The height of the rectangle from which the pixel data will be retrieved
callback(pixelInformation: object) => voidundefinedcallback function

Returns ​

void

Inherited from ​

ImagePixelInformation.uniGetImageData

Defined in ​

components/imagePixelInformation/index.ts:8