ice Posted July 3, 2016 Share Posted July 3, 2016 Hi, how can i put a unimhtmlframe-canvas to unimimage ? Thanks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 3, 2016 Share Posted July 3, 2016 Hi, Sorry, can you clarify your question ?! Or show a snippet of code ? Best regards. Quote Link to comment Share on other sites More sharing options...
ice Posted July 3, 2016 Author Share 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 Link to comment Share on other sites More sharing options...
Sherzod Posted July 3, 2016 Share Posted July 3, 2016 Ok, now it is clear, thank you.. I will try to give a solution. Quote Link to comment Share on other sites More sharing options...
zilav Posted July 4, 2016 Share Posted July 4, 2016 Like this one? http://forums.unigui.com/index.php?/topic/2019-loading-unicanvas-and-native-canvas-to-db/ Quote Link to comment Share on other sites More sharing options...
ice Posted July 4, 2016 Author Share Posted July 4, 2016 Hi zllav, thank you. In Unim(Touch) in no canvas componet. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 4, 2016 Share 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 Link to comment Share on other sites More sharing options...
ice Posted July 4, 2016 Author Share Posted July 4, 2016 Hi Delphi Developer, thank you very much. 1+* 1 Quote Link to comment Share on other sites More sharing options...
gerhardhziegler Posted May 28, 2019 Share Posted May 28, 2019 Sherzod is the best! I find the answers already before I can make my question! Thanx to all 1 Quote Link to comment Share on other sites More sharing options...
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.