Bonjour à tous,
Je fais une petite appli. D10/Android pour faire signer les clients sur une tablette, ce code fonctionne correctement pour gérer la signature mais la sauvegarde est une image fond noir sans la signature !!!
Pourriez-vous me guider pour la sauvegarde de la signature dans un fichier svp ?
Merci à tous
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 procedure TForm1.BClearClick(Sender: TObject); begin Rectangle1.Fill.Kind := TBrushKind.None; Path1.Data.Clear; Layout1.Repaint; end; procedure TForm1.BSauveClick(Sender: TObject); Var B : TBrushBitmap; F : String; begin F := System.IOUtils.TPath.Combine(System.IOUtils.TPath.GetSharedDownloadsPath(), 'Essai.jpg'); B := TBrushBitmap.Create; B.Bitmap.Assign (Path1.MakeScreenshot); B.Bitmap.Resize (Trunc (Path1.Width), Trunc (Path1.Height)); B.Bitmap.SaveToFile (F); Rectangle1.Fill.Kind := TBrushKind.Bitmap; Rectangle1.Fill.Bitmap.Assign (B); Path1.Data.Clear; end; procedure TForm1.RoundRect1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin If ssLeft In Shift Then Path1.Data.MoveTo (TPointF.Create (X,Y)); end; procedure TForm1.RoundRect1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); begin If ssLeft In Shift Then Begin Path1.Data.LineTo (TPointF.Create (X,Y)); RoundRect1.Repaint; End; end;
Partager