Ejemplo n.º 1
0
        private IImage loadImage(IBitmap bitmap, ILoadImageConfig config = null, string id = null)
        {
            id = id ?? Guid.NewGuid().ToString();
            IImage image = null;

            _renderThread.RunBlocking(() =>
            {
                ITexture tex = createTexture(config);
                image        = loadImage(tex, bitmap, id, config, null);
            });
            return(image);
        }
Ejemplo n.º 2
0
        private IBitmap loadBitmap(IResource resource)
        {
            IBitmap bitmap = null;

            _renderThread.RunBlocking(() =>
            {
                try
                {
                    bitmap = _bitmapLoader.Load(resource.Stream);
                }
                catch (ArgumentException e)
                {
                    Debug.WriteLine("Failed to load image from {0}, is it really an image?\r\n{1}", resource.ID, e.ToString());
                }
            });
            return(bitmap);
        }