Character Portrait path breaks when you send sheets to other machines

Post/Author/DateTimePost
#1

iam_bkee

Sep 16, 2009 16:28:04

Particularly if you bounce between 64 and 32 bit machines.  You have the same problem if you use a custom pick that doesn't ship with the character generator.  Recommend the image be encoded into the xml instead of using a reference path.


// Encode Image to string
public static string GetString(Image image){
    MemoryStream mem = new MemoryStream();
    image.Save(mem, System.Drawing.Imaging.ImageFormat.Bmp);
    byte[] bytes = mem.ToArray();
    string base64string = Convert.ToBase64String(bytes);

    return base64string;
}

// Decode string to Image
public static Bitmap GetImage(string base64string){
    byte[] bytes = Convert.FromBase64String(base64string);
    MemoryStream mem = new MemoryStream(bytes);
    Bitmap bmp = new Bitmap(mem);

    return bmp;
}

#2

mdonais

Sep 22, 2009 23:34:16

I think this was discussed and there were some disadvantages to it.


I will ask the dev team.


Thanks for the specific feedback.