File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 "outputPath" : " dist/dev-app" ,
5454 "index" : " projects/dev-app/src/index.html" ,
5555 "browser" : " projects/dev-app/src/main.ts" ,
56- "polyfills" : [
57- " zone.js"
58- ],
5956 "tsConfig" : " projects/dev-app/tsconfig.app.json" ,
6057 "inlineStyleLanguage" : " scss" ,
6158 "assets" : [
Original file line number Diff line number Diff line change 1- import { ApplicationConfig , provideZoneChangeDetection } from '@angular/core' ;
1+ import {
2+ ApplicationConfig ,
3+ provideBrowserGlobalErrorListeners ,
4+ provideZonelessChangeDetection ,
5+ } from '@angular/core' ;
26import { provideRouter } from '@angular/router' ;
37
48import { routes } from './app.routes' ;
59
610export const appConfig : ApplicationConfig = {
7- providers : [ provideZoneChangeDetection ( { eventCoalescing : true } ) , provideRouter ( routes ) ] ,
11+ providers : [
12+ provideBrowserGlobalErrorListeners ( ) ,
13+ provideZonelessChangeDetection ( ) ,
14+ provideRouter ( routes ) ,
15+ ] ,
816} ;
Original file line number Diff line number Diff line change 11< mat-toolbar >
22 < span > Watermark</ span >
33
4- @if (image) {
4+ @if (image() ) {
55 < button mat-stroked-button (click) ="restore() "> Restore</ button >
66 } @else {
77 < button mat-stroked-button (click) ="decrypt() "> Decrypt blind watermark</ button >
2929 < main watermark [watermarkOptions] ="options ">
3030 < p > Add watermark to your page.</ p >
3131
32- @if (image) {
33- < img [src] ="image " alt ="blind watermark decyption image " width ="100% " height ="100% " />
32+ @if (image() ) {
33+ < img [src] ="image() " alt ="blind watermark decyption image " width ="100% " height ="100% " />
3434 }
3535 </ main >
3636</ div >
Original file line number Diff line number Diff line change 11import { GuiFields , GuiModule } from '@acrodata/gui' ;
22import { Watermark , WatermarkDirective , WatermarkOptions } from '@acrodata/watermark' ;
3- import { Component , OnInit } from '@angular/core' ;
3+ import { Component , OnInit , signal } from '@angular/core' ;
44import { MatButtonModule } from '@angular/material/button' ;
55import { MatToolbarModule } from '@angular/material/toolbar' ;
66import html2canvas from 'html2canvas' ;
@@ -145,6 +145,7 @@ export class App implements OnInit {
145145 } ,
146146 fontColor : {
147147 type : 'fill' ,
148+ mode : 'solid' ,
148149 name : 'fontColor' ,
149150 default : '#000' ,
150151 } ,
@@ -183,7 +184,7 @@ export class App implements OnInit {
183184 } ,
184185 } ;
185186
186- image = '' ;
187+ image = signal ( '' ) ;
187188
188189 ngOnInit ( ) : void {
189190 html2canvas ( document . querySelector ( 'main' ) ! , { useCORS : true } ) ;
@@ -200,11 +201,11 @@ export class App implements OnInit {
200201 if ( ctx ) {
201202 // 处理像素解密盲水印
202203 Watermark . decrypt ( ctx ) ;
203- this . image = canvas . toDataURL ( ) ;
204+ this . image . set ( canvas . toDataURL ( ) ) ;
204205 }
205206 }
206207
207208 restore ( ) {
208- this . image = '' ;
209+ this . image . set ( '' ) ;
209210 }
210211}
You can’t perform that action at this time.
0 commit comments