Fixed issue #5: Color representation. MQL uses different color representation than C# System.Drawing.Color (Thanks Tr4Dr).

This commit is contained in:
DW
2016-05-13 11:53:28 +03:00
parent 05d762977b
commit 13c3ce1445
2 changed files with 20 additions and 4 deletions
+2 -2
View File
@@ -10,12 +10,12 @@ namespace MtApi
{
public static Color ConvertFromMtColor(int color)
{
return Color.FromArgb(color);
return Color.FromArgb((byte)(color), (byte)(color >> 8), (byte)(color >> 16));
}
public static int ConvertToMtColor(Color color)
{
return color == Color.Empty ? 0xffffff : (color.ToArgb() & 0xffffff);
return color == Color.Empty ? 0xffffff : (Color.FromArgb(color.B, color.G, color.R).ToArgb() & 0xffffff);
}
}
}