1
1
Fork 0
mirror of https://github.com/boxgaming/qbjs.git synced 2024-09-28 06:27:47 +00:00

samples update

This commit is contained in:
boxgaming 2024-03-25 15:52:07 -05:00
parent fe0bf4a223
commit 1c3d787ce4
4 changed files with 9 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

View file

@ -2,9 +2,13 @@ Export Render
IncludeJS "https://cdnjs.cloudflare.com/ajax/libs/camanjs/4.0.0/caman.full.min.js"
Sub Render(opts)
Dim lastOpts As Object
Sub Render(opts, imageId)
$If Javascript Then
Caman("#gx-canvas", function() {
var complete = false;
if (imageId == undefined) { imageId = 0; }
Caman(QB.getImage(imageId), function() {
if (opts.brightness) { this.brightness(opts.brightness); }
if (opts.contrast) { this.contrast(opts.contrast); }
if (opts.saturation) { this.saturation(opts.saturation); }
@ -18,6 +22,9 @@ $If Javascript Then
if (opts.sharpen) { this.sharpen(opts.sharpen); }
if (opts.blur) { this.stackBlur(opts.blur); }
this.render();
lastOpts = opts;
complete = true;
});
while (!complete) { await GX.sleep(10); }
$End If
End Sub