コード例 #1
0
        /// <summary>
        /// Creates a renderable object from the specified <see cref="Bitmap"/> object, and the specified
        /// <see cref="FileReference"/> it is associated with.
        /// NOTE: This method *must* be called in the UI thread after the OpenGL context has been made current.
        ///
        /// The <see cref="IRenderable"/> constructors commonly make extensive use of OpenGL methods.
        /// </summary>
        /// <param name="bitmapImage">The image object.</param>
        /// <param name="fileReference">The package group it belongs to.</param>
        /// <returns>An encapsulated renderable OpenGL object.</returns>
        public static IRenderable CreateRenderableBitmapImage(Bitmap bitmapImage, FileReference fileReference)
        {
            if (bitmapImage == null)
            {
                return(null);
            }

            RenderableBitmap renderableImage = new RenderableBitmap(bitmapImage, fileReference.FilePath);

            return(renderableImage);
        }
コード例 #2
0
        /// <summary>
        /// Creates a renderable object from the specified <see cref="Bitmap"/> object, and the specified
        /// <see cref="FileReference"/> it is associated with.
        /// NOTE: This method *must* be called in the UI thread after the OpenGL context has been made current.
        /// The <see cref="IRenderable"/> constructors commonly make extensive use of OpenGL methods.
        /// </summary>
        /// <param name="bitmapImage">The image object.</param>
        /// <param name="fileReference">The reference it was constructed from.</param>
        /// <returns>An encapsulated renderable OpenGL object.</returns>
        public static IRenderable CreateRenderableBitmapImage(Bitmap bitmapImage, FileReference fileReference)
        {
            var renderableImage = new RenderableBitmap(bitmapImage, fileReference.FilePath);

            return(renderableImage);
        }