User talk:Dan Bron/Snippets/PrettyPictures

From J Wiki
Jump to: navigation, search
  • Errors represented with [\] -- Oleg Kobchenko <<DateTime(2008-12-16T03:12:11-0500)>>
  • Consider adding glwh to standardize picture size for screenshots. -- Oleg Kobchenko <<DateTime(2006-12-13T01:37:50Z)>>
  • As samples, pictures for smallest nice rectangular size of viewmat: 121, i.e. n=60 -- Oleg Kobchenko <<DateTime(2006-12-13T06:35:40Z)>>
  • Here is more compact thumbnail layout:
001.png 1. filled in circle


002.png 2. hollow circle

= <.

3. Bullseye, delta-circumference = 1


004.png 4. Bullseye, delta-circumference = m

m ([ * [: <. 0.5 + %~) ]

-- Oleg Kobchenko <<DateTime(2006-12-13T06:50:08Z)>>

Oleg provided a mechanism to save viewmat images to PNG files, so I feel that the following should generate all the image files for this table. However, it does not; I just get a bunch of empty white images.

Debugging indicates that it is probably a repaint/selected window issue. I do not know how to fix it.

load 'viewmat media/platimg debug'
coinsert 'jgl2'

PP      =:  1 : 'viewmat@:(u [: | j./~@:i:)'
glqall  =:  (|. $ [:glqpixels 0 0&,)@glqwh
glwh    =:  3 : 'wd''pmovex '',(+0 0,y-glqwh_jgl2_@$@#)&.".wd''qformx'''

ppp     =:  dyad define           NB. Pretty picture print

     ". '(',y,') PP 60'

     NB.  jvm_g_paint_jviewmat_ :: 0: ''
     glwh 4 3*30
     NB.  jvm_g_paint_jviewmat_ :: 0: ''

     (glqall'') writeimg jpath '~temp\pp\',x,'.png'


A       =:  '>' ; '= <.' ; '<.@:]'                              NB.  Etc
B       =:  'filled_in_circle' ; 'hollow_circle' ; 'bullseye'   NB.  Etc

B ppp&.> A
-- Dan Bron <<DateTime(2007-03-16T15:42:32Z)>>

Well this steps into the uncharted treacherous territory of sync programmatic execution and async GUI. So I guess to do it like that, the use of timer might help. But that's an overkill.

I recommend using something that is proven and supported like the animate addon. You can designate each picture as a step in the animation. And all will be saved nicely in a series of files. I guess you could take it further by making code that will convert your boxed list of picture verbs into a script for animate automatically. Or have just one new animate script that will accept a list of picture verbs in some form and derive number of steps, etc. Maybe an Options dialog.

-- Oleg Kobchenko <<DateTime(2007-03-16T16:35:59Z)>>