Click here to Skip to main content
15,868,016 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: not able to save image which is already saved with same name and to the same location Pin
TnTinMn8-Feb-14 8:43
TnTinMn8-Feb-14 8:43 
GeneralRe: not able to save image which is already saved with same name and to the same location Pin
ven7539-Feb-14 2:13
ven7539-Feb-14 2:13 
AnswerRe: not able to save image which is already saved with same name and to the same location Pin
PKJain7512-Feb-14 23:51
professionalPKJain7512-Feb-14 23:51 
Questionpopulating data from datagridview into textboxes Pin
Member 105062157-Feb-14 1:10
Member 105062157-Feb-14 1:10 
QuestionRe: populating data from datagridview into textboxes Pin
Eddy Vluggen7-Feb-14 8:55
professionalEddy Vluggen7-Feb-14 8:55 
QuestionError in conversion of application Pin
Ashish Sharma6-Feb-14 18:18
Ashish Sharma6-Feb-14 18:18 
AnswerRe: Error in conversion of application Pin
thatraja6-Feb-14 20:24
professionalthatraja6-Feb-14 20:24 
Questionnot able to Deserialize json signature lines Pin
ven7534-Feb-14 18:36
ven7534-Feb-14 18:36 
hi
I am using json signature and trying deserialize but i am not able to deserialize. below is my json string
{"lines":[[[156.44,96.44],[156.44,95.33],[155.33,94.22],[154.22,93.11],[154.22,90.89],[153.11,89.78],[150.89,87.56],[150.89,84.22],[148.67,83.11],[147.56,80.89],[146.44,78.67],[144.22,76.44],[142,74.22],[139.78,70.89],[136.44,67.56],[134.22,65.33],[130.89,63.11],[128.67,60.89],[126.44,59.78],[124.22,57.56],[123.11,57.56],[122,56.44],[118.67,56.44],[116.44,56.44],[114.22,56.44],[112,56.44],[108.67,56.44],[105.33,56.44],[99.78,56.44],[96.44,57.56],[93.11,59.78],[89.78,60.89],[87.56,62],[86.44,64.22],[84.22,66.44],[83.11,67.56],[80.89,69.78],[79.78,70.89],[78.67,74.22],[77.56,75.33],[77.56,77.56],[77.56,79.78],[77.56,82],[77.56,84.22],[77.56,86.44],[77.56,88.67],[78.67,90.89],[78.67,93.11],[80.89,95.33],[82,97.56],[85.33,98.67],[87.56,99.78],[89.78,102],[93.11,102],[96.44,104.22],[100.89,105.33],[107.56,107.56],[114.22,108.67],[120.89,109.78],[125.33,110.89],[130.89,110.89],[134.22,112],[137.56,113.11],[139.78,114.22],[142,115.33],[143.11,115.33],[144.22,116.44],[145.33,116.44],[147.56,117.56],[147.56,118.67],[148.67,119.78],[149.78,122],[150.89,122],[150.89,124.22],[150.89,126.44],[150.89,127.56],[150.89,129.78],[150.89,132],[150.89,134.22],[149.78,135.33],[148.67,137.56],[147.56,139.78],[145.33,142],[144.22,144.22],[143.11,145.33],[139.78,146.44],[137.56,147.56],[135.33,147.56],[133.11,147.56],[129.78,147.56],[126.44,148.67],[124.22,148.67],[120.89,148.67],[118.67,148.67],[114.22,148.67],[109.78,148.67],[105.33,148.67],[102,148.67],[99.78,148.67],[97.56,148.67],[94.22,148.67],[92,148.67],[88.67,148.67],[86.44,148.67],[84.22,148.67],[83.11,148.67],[82,148.67],[79.78,148.67],[79.78,147.56],[77.56,147.56],[76.44,146.44],[75.33,146.44],[75.33,146.44],[75.33,146.44],[75.33,145.33],[74.22,145.33],[74.22,143.11],[73.11,140.89],[70.89,138.67],[70.89,137.56],[69.78,135.33],[69.78,135.33],[69.78,135.33],[69.78,133.11],[69.78,133.11],[69.78,133.11],[69.78,133.11],[69.78,132]]]}

i used code like below to deserialize
public Bitmap SigJsonToImage(string json)
{
var signatureImage = GetBlankCanvas();
if (!string.IsNullOrEmpty(json))
{
using (var signatureGraphic = Graphics.FromImage(signatureImage))
{
signatureGraphic.SmoothingMode = SmoothingMode.AntiAlias;
var pen = new Pen(PenColor, PenWidth);
var serializer = new JavaScriptSerializer();
var lines = serializer.Deserialize<list<signatureline>>(json);
foreach (var line in lines)
{
signatureGraphic.DrawLine(pen, line.lx, line.ly, line.mx, line.my);
}
}
}
return signatureImage;
}


here i am getting lines count 0 and it is not coming inside codesignatureGraphic.DrawLine

private class SignatureLine
{
public int lx { get; set; }
public int ly { get; set; }
public int mx { get; set; }
public int my { get; set; }
}
private Bitmap GetBlankCanvas()
{
var blankImage = new Bitmap(CanvasWidth, CanvasHeight);
blankImage.MakeTransparent();
using (var signatureGraphic = Graphics.FromImage(blankImage))
{
signatureGraphic.Clear(BackgroundColor);
}
return blankImage;
}

how to achieve this. anybody knows please reply me.
thanks in advance

modified 5-Feb-14 4:35am.

AnswerRe: not able to Deserialize json signature lines Pin
Richard Deeming5-Feb-14 2:57
mveRichard Deeming5-Feb-14 2:57 
GeneralRe: not able to Deserialize json signature lines Pin
ven7535-Feb-14 5:17
ven7535-Feb-14 5:17 
GeneralRe: not able to Deserialize json signature lines Pin
Richard Deeming5-Feb-14 5:35
mveRichard Deeming5-Feb-14 5:35 
GeneralRe: not able to Deserialize json signature lines Pin
ven7535-Feb-14 6:11
ven7535-Feb-14 6:11 
GeneralRe: not able to Deserialize json signature lines Pin
Richard Deeming5-Feb-14 6:50
mveRichard Deeming5-Feb-14 6:50 
GeneralRe: not able to Deserialize json signature lines Pin
ven7535-Feb-14 7:18
ven7535-Feb-14 7:18 
GeneralRe: not able to Deserialize json signature lines Pin
Richard Deeming5-Feb-14 8:01
mveRichard Deeming5-Feb-14 8:01 
GeneralRe: not able to Deserialize json signature lines Pin
ven7535-Feb-14 16:09
ven7535-Feb-14 16:09 
GeneralRe: not able to Deserialize json signature lines Pin
Richard Deeming6-Feb-14 1:37
mveRichard Deeming6-Feb-14 1:37 
GeneralRe: not able to Deserialize json signature lines Pin
ven7536-Feb-14 6:54
ven7536-Feb-14 6:54 
GeneralRe: not able to Deserialize json signature lines Pin
Richard Deeming6-Feb-14 8:56
mveRichard Deeming6-Feb-14 8:56 
GeneralRe: not able to Deserialize json signature lines Pin
ven7536-Feb-14 16:18
ven7536-Feb-14 16:18 
GeneralRe: not able to Deserialize json signature lines Pin
ven7536-Feb-14 21:34
ven7536-Feb-14 21:34 
GeneralRe: not able to Deserialize json signature lines Pin
ven7537-Feb-14 7:03
ven7537-Feb-14 7:03 
GeneralRe: not able to Deserialize json signature lines Pin
Richard Deeming10-Feb-14 1:27
mveRichard Deeming10-Feb-14 1:27 
Question3 layers architecture & MVC Pin
kryptong4-Feb-14 3:20
kryptong4-Feb-14 3:20 
AnswerRe: 3 layers architecture & MVC Pin
Eddy Vluggen4-Feb-14 7:55
professionalEddy Vluggen4-Feb-14 7:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.