I think that with or without the setsizeloc_jviewmat_, you won't save the
intended bmp because it require the paint event to do the actual rendering and
that event will not happen when J is running a sentence or script. eg.
savemat_jviewmat_ 'z:/tmp/SineStripes.bmp' [ viewmat 1 o. +/~i:6j999
There should already some discussions on similar issues in the past. A possible
workaround is to modify the paint event code of jviewmat and put your savemat there.
Devon McCormick wrote:
Members of the forum -
I'm experimenting with saving bitmaps generated by "viewmat". However, I
find my usual method of incremental development gets snagged on some kind of
windowing oddness. My interactive experiment went like this:
viewmat 1 o. +/~i:6j999
setsizeloc_jviewmat_ 0 0 1000 1000
savemat_jviewmat_ pixdir,'SineStripes.bmp'
where "pixdir" is the directory where I store my bitmaps
and savemat_jviewmat_
sets the size and location of the viewmat window like this:
setsizeloc_jviewmat_=: 3 : 0
if. 0=#fms=. hforms'' do.
wdinfo 'viewmat';'No viewmat forms.' return.
end.
wd 'psel ',(<0 1) pick fms
wd 'pmovex ',":y
NB.EG setsizeloc 10 10 240 240
)
I'm resizing it to save a bitmap larger than the default.
However, when I put the first three lines into a
function, the resulting file saved has only 64K (instead of 2.7MB) and
does not display as a valid bitmap.
The same thing happens when I put the three lines into a single statement
separated by "["s.
Something happens, in the timing or otherwise, of returning to immediate
execution. Inserting wait statements doesn't help - in fact this seems to
freeze the display of the picture frame, before filling it in, for the wait
time.
Is there an obvious way to fix this or better way to save viewmats?
Thanks,
Devon
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm