Turn a MATLAB plot into image
You can use GETFRAME function. It returns movie frame structure, which is actually rasterized figure. Field cdata will contain your matrix. F=getframe; figure(2) imagesc(F.cdata);
You can use GETFRAME function. It returns movie frame structure, which is actually rasterized figure. Field cdata will contain your matrix. F=getframe; figure(2) imagesc(F.cdata);
I managed to get this working. I ended up with hardcoded 17 shade patterns of size 8×8 pixels (created manually in Paint). These are the shades: From there I just use x,y of rendered pixel mod 8 as coordinate in the LUT of shades. This is the result: As you can see its much more … Read more
if it helps a bit here is my ancient C++ source for triangle in VCL/GDI: //————————————————————————— class gfx_main { public: Graphics::TBitmap *bmp; int **pyx,xs,ys; gfx_main(); ~gfx_main(); void resize(int _xs=-1,int _ys=-1); void troj(int x0,int y0,int x1,int y1,int x2,int y2,int col); // this is filled triangle void _troj_line(int *pl,int *pr,int x0,int y0,int x1,int y1); // this is … Read more