Esempio n. 1
0
        public static async Task <Image> ToImage(this DxfImage i, Func <string, Task <byte[]> > contentResolver)
        {
            var data = await contentResolver(i.ImageDefinition.FilePath);

            var width    = i.UVector.Length * i.ImageSize.X;
            var height   = i.VVector.Length * i.ImageSize.Y;
            var rotation = Math.Atan2(i.UVector.Y, i.UVector.X) * MathHelper.RadiansToDegrees;
            var image    = new Image(i.Location.ToPoint(), i.ImageDefinition.FilePath, data, width, height, rotation, i.GetEntityColor());

            return(image);
        }