asapltda Posted April 13, 2020 Posted April 13, 2020 Good morning, Foristas. Could someone tell me how to write text in TUnimCanvas. I want when the canvas is shown in this the system date and time appear. thank you
Sherzod Posted April 13, 2020 Posted April 13, 2020 51 minutes ago, asapltda said: Could someone tell me how to write text in TUnimCanvas. Hello, Uses ..., uniGUIJSUtils;
asapltda Posted April 14, 2020 Author Posted April 14, 2020 tks mr Sherzod, I have never javascrip, could put an explicit example in delphi Thanks
Sherzod Posted April 14, 2020 Posted April 14, 2020 1 minute ago, asapltda said: I have never javascrip, could put an explicit example in delphi Thanks An example is given there. Uses ... , UniGUIJSUtils; procedure TMainmForm.UnimButton1Click(Sender: TObject); begin UnimCanvas1.JSInterface.JSCode('var me='#1'._cc_; if (me) {me.fillStyle="'+ uniColor2Web(clGreen, 1) +'"; me.font="20px sans-serif"; me.fillText("test", 100, 100)};'); end;
asapltda Posted April 14, 2020 Author Posted April 14, 2020 Tks Sherzod. Muestra procedimiento TFREMESASCONFIMARECIBO.GRABAR_FECHAHORA; var w_Str_fechaHora: cadena; w_javascrip: String; comenzar DateTimeToString (w_Str_fechaHora, 'aaaa-mm-dd hh: mm', ahora ()); w_javascrip: = 'var me =' # 1 '._ cc_; if (me) {me.fillStyle = "'+ uniColor2Web (clGreen, 1) +'"; me.font = "20px sans-serif"; me.fillText ("% s", 10, 20)}; '; w_javascrip: = formato (w_javascrip, [w_Str_fechaHora]); UniCanvas .JSInterface.JSCode (w_javascrip); final;
Recommended Posts