[]
Document Solutions Image Viewer - v7.2.0 / IViewerPlugin
The GcImageViewer allows to extend its behavior and add new functionality using plug-ins.
Example
// Define class SamplePlugin:
function SamplePlugin() {
}
SamplePlugin.prototype = {
_onAfterOpenUnregister: null,
id: "SamplePluginV1",
initialize: function(viewer) {
this._onAfterOpenUnregister = viewer.onAfterOpen.register(() => {
viewer.showMessage("onAfterOpen was called in the SamplePlugin.");
});
},
dispose: function() {
if(this._onAfterOpenUnregister){
this._onAfterOpenUnregister();
delete this._onAfterOpenUnregister;
}
}
}
// Create GcImageViewer and initialize the SamplePlugin:
var viewer = new GcImageViewer("#viewer");
viewer.addPlugin(new SamplePlugin());
viewer.open("https://i.imgur.com/tl0ZsW7.jpeg");
• id: string
Unique plug-in identifier.
▸ initialize(viewer
): void
The method is called when the GcImageViewer component is initialized.
Name | Type |
---|---|
viewer |
GcImageViewer |
void
▸ dispose(): void
The method is called when the GcImageViewer component is about to be disposed.
void