/// <summary> /// Initializes the texture image. /// </summary> /// <param name="image">The texture image.</param> /// <param name="bitmap">The source bitmap.</param> /// <param name="x">The tile X coordinate.</param> /// <param name="y">The tile Y coordinate.</param> /// <param name="size">The tile size.</param> private void Initialize(TextureImage image, Bitmap bitmap, int x, int y, int size) { using (var tile = bitmap.Clone(x * size, y * size, size, size)) { tile.PinAsReadOnly(data => image.Initialize(size, size, GL.BGRA, data)); } }