Share your advanced knowledge/code with the community.
User avatar
Peter
 
Posts: 625
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1

Painterro-Demo

by Peter Fri Sep 27, 2019 6:57 am

Painterro on GitHub wrote:Painterro is JavaScript painting widget (paint library) which allows editing images in a browser.
It can be easily integrated into your website or blog by including only one JS file and calling initialization code.


Proof of Concept - Code:
Code: Select all
EnableExplicit

#Window = 0
#Container = 0

Procedure.i LoadAsynchronously(FileName.s, *OnLoadFunction, FileType.s)
  ; by eddy: https://forums.spiderbasic.com/viewtopic.php?p=232#p232
  !return $.ajax({ url:v_filename, dataType:v_filetype, beforeSend:function(jqxhr, settings) { jqxhr.url = settings.url; } })
  !.done(function(data, status, jqxhr) { p_onloadfunction(data,status,jqxhr.url); })
  !.fail(function(jqxhr, status, errorThrown) { p_onloadfunction('',status,jqxhr.url,jqxhr.status,errorThrown); });
EndProcedure

Procedure PainterroReady()
 
  OpenWindow(#Window, #PB_Ignore, #PB_Ignore, 800, 600, "Painterro-Demo", #PB_Window_ScreenCentered) 
 
  ContainerGadget(#Container, 0, 0, WindowWidth(#Window), WindowHeight(#Window))
 
  Protected GadgetID = GadgetID(#Container)
 
  ! Painterro( { id: $(v_gadgetid.div.innerHTML)[0].id } ).show();
 
EndProcedure

LoadAsynchronously("https://cdn.jsdelivr.net/npm/painterro@1.0.6/build/painterro.min.js", @PainterroReady(), "script")


Image


Dokumentation: https://github.com/ivictbor/painterro

Have fun ... Peter
Return to Tricks 'n' Tips

Who is online

Users browsing this forum: No registered users and 0 guests