LoadBitmap() public static method

Loads bitmap in the manifest resource.
public static LoadBitmap ( string filename, int stackIndex = 2 ) : Bitmap
filename string
stackIndex int
return System.Drawing.Bitmap
Ejemplo n.º 1
0
        protected override void DoInitialize()
        {
            base.DoInitialize();

            Bitmap bitmap;

            if (string.IsNullOrEmpty(this.bitmapFilename))// display a cursor as default.
            {
                bitmap = ManifestResourceLoader.LoadBitmap(@"Resources\cursor_gold.png");
            }
            else
            {
                bitmap = new Bitmap(this.bitmapFilename);
            }
            var texture = new Texture(TextureTarget.Texture2D, bitmap, new SamplerParameters());

            texture.Initialize();
            bitmap.Dispose();
            this.SetUniform("tex", texture);
        }
Ejemplo n.º 2
0
        protected override void DoInitialize()
        {
            base.DoInitialize();

            Bitmap bitmap;

            if (string.IsNullOrEmpty(this.bitmapFilename))// display a cursor as default.
            {
                bitmap = ManifestResourceLoader.LoadBitmap(@"Resources\cursor_gold.png");
            }
            else
            {
                bitmap = new Bitmap(this.bitmapFilename);
            }
            var texture = new Texture(bitmap);

            texture.Initialize();
            bitmap.Dispose();
            this.SetUniform("tex", new samplerValue(BindTextureTarget.Texture2D,
                                                    texture.Id, OpenGL.GL_TEXTURE0));
        }