示例#1
0
        public void DrawBitmap(UBitmap bitmap, float opacity, UInterp interp, Rectangle source, Rectangle destination)
        {
            var rd = bitmap.Retreive <OTKDraw>(() =>
            {
                var bd    = bitmap.bitmapData ?? System.IO.File.ReadAllBytes(bitmap.bitmapFile);
                var dt    = new distex();
                var sz    = LoadBitmapIntoTexture(dt.tex, bd);
                dt.width  = sz.Width;
                dt.height = sz.Height;
                return(dt);
            }) as distex;

            int st = rel.renderData.sofwareBuffer.Count;

            bufferTexRect(destination,
                          new Rectangle(
                              source.left / rd.width,
                              source.top / rd.height,
                              source.width / rd.width,
                              source.height / rd.height
                              )
                          );
            int cnt = rel.renderData.sofwareBuffer.Count - st;

            rel.renderData.bufferInfo.Add(new RenderInfo(st, cnt, ArrayData.Vertex | ArrayData.Texture | ArrayData.Color, PrimitiveType.Quads, rd.tex));

            //var bm = SaveTextureIntoBitmap(rd.tex, rd.width, rd.height);
            //bm.Save("test.png",sdg.Imaging.ImageFormat.Png);
            //System.Diagnostics.Process.Start("test.png");
        }
示例#2
0
 Bitmap CreateBitmap(UBitmap b)
 {
     return(b.Retreive <SDG_RenderElements>(new NoCacheDelegate(() => CreateNewBitmap(b))) as Bitmap);
 }