ice Posted July 3, 2016 Posted July 3, 2016 Hi, how can i put a unimhtmlframe-canvas to unimimage ? Thanks Quote
Sherzod Posted July 3, 2016 Posted July 3, 2016 Hi, Sorry, can you clarify your question ?! Or show a snippet of code ? Best regards. Quote
ice Posted July 3, 2016 Author Posted July 3, 2016 Hi, i make a canvas in unimhtmlframe and make a signatue-script in javascript. unimhtmlframe: <canvas id="signatur"> javascript:(signatur.js) by addjs. it work. now i like to save it to database. my idee is too put it in a unimimage and save it to a database. Quote
Sherzod Posted July 3, 2016 Posted July 3, 2016 Ok, now it is clear, thank you.. I will try to give a solution. Quote
zilav Posted July 4, 2016 Posted July 4, 2016 Like this one? http://forums.unigui.com/index.php?/topic/2019-loading-unicanvas-and-native-canvas-to-db/ Quote
ice Posted July 4, 2016 Author Posted July 4, 2016 Hi zllav, thank you. In Unim(Touch) in no canvas componet. Quote
Sherzod Posted July 4, 2016 Posted July 4, 2016 Hi, Try.. exemplary implementation: 1. uses ... Soap.EncdDecd; 2. procedure TMainmForm.UnimButton1Click(Sender: TObject); begin UniSession.AddJS('ajaxRequest('+ UnimImage1.JSName +', "_img", ["_src="+document.getElementById("signatur").toDataURL()])'); end; 3. procedure TMainmForm.UnimImage1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); var stream: TBytesStream; base64s: string; begin if EventName = '_img' then begin base64s := Params.Values['_src']; base64s := StringReplace(base64s, 'data:image/png;base64,', '', [rfReplaceAll]); stream := TBytesStream.Create(DecodeBase64(base64s)); try UnimImage1.LoadFromStream(stream); finally stream.Free; end; end; end; Best regards. 3 Quote
ice Posted July 4, 2016 Author Posted July 4, 2016 Hi Delphi Developer, thank you very much. 1+* 1 Quote
gerhardhziegler Posted May 28, 2019 Posted May 28, 2019 Sherzod is the best! I find the answers already before I can make my question! Thanx to all 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.