Markup Editor Events
A list of events which we can use to respond to the markup editor state appropriatly.
Name | Description |
---|---|
'selectstyle' |
Fired when a style value is selected, receives style props and values. |
'addshape' |
Fired when a shape is added, receives added shape. |
'selectshape' |
Fired when a shape is selected, receives selected shape. |
'tapshape' |
Fired when a selected shape is clicked or tapped, receives shape. |
'updateshape' |
Fired when a shape is updated, receives updated shape. |
'removeshape' |
Fired when a shape is removed, receives removed shape. |
'markupzoom' |
Fired when markup editor zooms in or out on image. |
'markuppan' |
Fired when markup editor pans image. |
'markuptap' |
Fired when markup editor canvas is tapped. |
'blurshape' |
Fired when a shape is blurred. |
'selectiondown' |
Fired when a selection interaction starts. |
'selectionup' |
Fired when selection interaction ends. |
'selectionchange' |
Fired when selection updates. |
selectstyle
Fired when a style is selected in a style control.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('selectstyle', (shape) => {
console.log('selectstyle', shape);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorSelectstyle = (shape) => {
console.log('selectstyle', shape);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onSelectstyle={handleEditorSelectstyle}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:selectstyle="handleEditorSelectstyle($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorSelectstyle: function (shape) {
console.log('selectstyle', shape);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorSelectstyle = (event) => {
const shape = event.detail;
console.log('selectstyle', shape);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:selectstyle={handleEditorSelectstyle}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorSelectstyle(shape: any): void {
console.log('selectstyle', shape);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(selectstyle)="handleEditorSelectstyle($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:selectstyle', function (event) {
const shape = event.detail;
console.log('selectstyle', shape);
});
});
</script>
addshape
Fired when a shape is added in the editor.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('addshape', (shape) => {
console.log('addshape', shape);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorAddshape = (shape) => {
console.log('addshape', shape);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onAddshape={handleEditorAddshape}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:addshape="handleEditorAddshape($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorAddshape: function (shape) {
console.log('addshape', shape);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorAddshape = (event) => {
const shape = event.detail;
console.log('addshape', shape);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:addshape={handleEditorAddshape}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorAddshape(shape: any): void {
console.log('addshape', shape);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(addshape)="handleEditorAddshape($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:addshape', function (event) {
const shape = event.detail;
console.log('addshape', shape);
});
});
</script>
selectshape
Fired when a shape is selected in the editor.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('selectshape', (shape) => {
console.log('selectshape', shape);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorSelectshape = (shape) => {
console.log('selectshape', shape);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onSelectshape={handleEditorSelectshape}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:selectshape="handleEditorSelectshape($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorSelectshape: function (shape) {
console.log('selectshape', shape);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorSelectshape = (event) => {
const shape = event.detail;
console.log('selectshape', shape);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:selectshape={handleEditorSelectshape}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorSelectshape(shape: any): void {
console.log('selectshape', shape);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(selectshape)="handleEditorSelectshape($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:selectshape', function (event) {
const shape = event.detail;
console.log('selectshape', shape);
});
});
</script>
tapshape
Fired when a selected shape is tapped or clicked in the editor.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('tapshape', (shape) => {
console.log('tapshape', shape);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorTapshape = (shape) => {
console.log('tapshape', shape);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onTapshape={handleEditorTapshape}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:tapshape="handleEditorTapshape($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorTapshape: function (shape) {
console.log('tapshape', shape);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorTapshape = (event) => {
const shape = event.detail;
console.log('tapshape', shape);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:tapshape={handleEditorTapshape}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorTapshape(shape: any): void {
console.log('tapshape', shape);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(tapshape)="handleEditorTapshape($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:tapshape', function (event) {
const shape = event.detail;
console.log('tapshape', shape);
});
});
</script>
updateshape
Fired when a shape is updated in the editor.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('updateshape', (shape) => {
console.log('updateshape', shape);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorUpdateshape = (shape) => {
console.log('updateshape', shape);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onUpdateshape={handleEditorUpdateshape}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:updateshape="handleEditorUpdateshape($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorUpdateshape: function (shape) {
console.log('updateshape', shape);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorUpdateshape = (event) => {
const shape = event.detail;
console.log('updateshape', shape);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:updateshape={handleEditorUpdateshape}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorUpdateshape(shape: any): void {
console.log('updateshape', shape);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(updateshape)="handleEditorUpdateshape($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:updateshape', function (event) {
const shape = event.detail;
console.log('updateshape', shape);
});
});
</script>
removeshape
Fired when a shape is removed in the editor.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('removeshape', (shape) => {
console.log('removeshape', shape);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorRemoveshape = (shape) => {
console.log('removeshape', shape);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onRemoveshape={handleEditorRemoveshape}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:removeshape="handleEditorRemoveshape($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorRemoveshape: function (shape) {
console.log('removeshape', shape);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorRemoveshape = (event) => {
const shape = event.detail;
console.log('removeshape', shape);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:removeshape={handleEditorRemoveshape}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorRemoveshape(shape: any): void {
console.log('removeshape', shape);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(removeshape)="handleEditorRemoveshape($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:removeshape', function (event) {
const shape = event.detail;
console.log('removeshape', shape);
});
});
</script>
markupzoom
Deprecated, please use generic editor 'zoom'
event instead.
Fired when markup editor zooms in or out on image.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('markupzoom', (value) => {
console.log('zoom level', value);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorMarkupzoom = (value) => {
console.log('zoom level', value);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onMarkupzoom={handleEditorMarkupzoom}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:markupzoom="handleEditorMarkupzoom($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorMarkupzoom: function (value) {
console.log('zoom level', value);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorMarkupzoom = (event) => {
const value = event.detail;
console.log('zoom level', value);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:markupzoom={handleEditorMarkupzoom}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorMarkupzoom(value: any): void {
console.log('zoom level', value);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(markupzoom)="handleEditorMarkupzoom($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:markupzoom', function (event) {
const value = event.detail;
console.log('zoom level', value);
});
});
</script>
markuppan
Deprecated, please use generic editor 'pan'
event instead.
Fired when markup editor pans image.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('markuppan', (translation) => {
console.log('translation', translation);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorMarkuppan = (translation) => {
console.log('translation', translation);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onMarkuppan={handleEditorMarkuppan}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:markuppan="handleEditorMarkuppan($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorMarkuppan: function (translation) {
console.log('translation', translation);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorMarkuppan = (event) => {
const translation = event.detail;
console.log('translation', translation);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:markuppan={handleEditorMarkuppan}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorMarkuppan(translation: any): void {
console.log('translation', translation);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(markuppan)="handleEditorMarkuppan($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:markuppan', function (event) {
const translation = event.detail;
console.log('translation', translation);
});
});
</script>
markuptap
Fired when markup editor canvas is tapped. Receives the tap position in the image context and an optiontal target shape.
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura.css" />
</head>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script type="module">
import { appendDefaultEditor } from './pintura.js';
const editor = appendDefaultEditor('#editor', { src: 'image.jpeg' });
editor.on('markuptap', (detail) => {
console.log('detail', detail);
});
</script>
import '@pqina/pintura/pintura.css';
import './App.css';
import { PinturaEditor } from '@pqina/react-pintura';
import { getEditorDefaults } from '@pqina/pintura';
const editorDefaults = getEditorDefaults();
function App() {
const handleEditorMarkuptap = (detail) => {
console.log('detail', detail);
};
return (
<div className="App">
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
onMarkuptap={handleEditorMarkuptap}
/>
</div>
);
}
export default App;
.pintura-editor {
height: 600px;
}
<template>
<div>
<PinturaEditor
v-bind="editorDefaults"
src="image.jpeg"
v-on:pintura:markuptap="handleEditorMarkuptap($event)"
/>
</div>
</template>
<script>
import { PinturaEditor } from '@pqina/vue-pintura';
import { getEditorDefaults } from '@pqina/pintura';
export default {
name: 'App',
components: {
PinturaEditor,
},
data() {
return {
editorDefaults: getEditorDefaults(),
};
},
methods: {
handleEditorMarkuptap: function (detail) {
console.log('detail', detail);
},
},
};
</script>
<style>
@import '@pqina/pintura/pintura.css';
.pintura-editor {
height: 600px;
}
</style>
<script>
import { PinturaEditor } from '@pqina/svelte-pintura';
import { getEditorDefaults } from '@pqina/pintura';
import '@pqina/pintura/pintura.css';
let editorDefaults = getEditorDefaults();
const handleEditorMarkuptap = (event) => {
const detail = event.detail;
console.log('detail', detail);
};
</script>
<div>
<PinturaEditor
{...editorDefaults}
src={'image.jpeg'}
on:markuptap={handleEditorMarkuptap}
/>
</div>
<style>
div :global(.pintura-editor) {
height: 600px;
}
</style>
import { Component } from '@angular/core';
import { getEditorDefaults } from '@pqina/pintura';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
editorDefaults: any = getEditorDefaults();
handleEditorMarkuptap(detail: any): void {
console.log('detail', detail);
}
}
<pintura-editor
[options]="editorDefaults"
src="image.jpeg"
(markuptap)="handleEditorMarkuptap($event)"
></pintura-editor>
::ng-deep .pintura-editor {
height: 600px;
}
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularPinturaModule } from '@pqina/angular-pintura';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularPinturaModule],
exports: [AppComponent],
providers: [],
bootstrap: [AppComponent],
})
export class AppModule {}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="./pintura/pintura.css" />
</head>
<script src="./jquery.js"></script>
<script src="./jquery-pintura/useEditorWithJQuery-iife.js"></script>
<script src="./pintura/pintura-iife.js"></script>
<style>
.pintura-editor {
height: 600px;
}
</style>
<div id="editor"></div>
<script>
useEditorWithJQuery(jQuery, pintura);
$(function () {
var editor = $('#editor').pinturaDefault({ src: 'image.jpeg' });
editor.on('pintura:markuptap', function (event) {
const detail = event.detail;
console.log('detail', detail);
});
});
</script>