2007/10/11, Hans Hagen <pragma@wxs.nl>:
> Wolfgang Schuster wrote:
> > Hi Hans,
> >
> > can you provide a backgroundimage key for localframed (ot use it in framed)
> > and fastlocalframed (to use it in \setupbackgrounds) to create something like:
> >
> > \setupexternalfigures[location=global]
> > \setupcolors[state=start]
> >
> > \starttext
> >
> > \defineoverlay
> >   [Wallpaper]
> >   [\backgroundimage{1}{\paperwidth}{\paperheight}{\externalfigure[cow]}]
> >
> > \setupbackgrounds
> >   [page]
> >   [background={color,Wallpaper},
> >    backgroundcolor=orange]
> >
> > \startstandardmakeup
> > \stopstandardmakeup
> >
> > \stoptext
> >
> > I want to write the above example in the following way,
> >
> > \setupbackgrounds
> >   [page]
> >   [background={color,image},
> >    backgroundcolor=orange,
> >    backgroundimage=cow]
> >
> > The same mechanism should be also possible for \framed.
> >
> > It should be possible to enable a image and a backgroundcolor at the same
> > time to have a fallback mechanism for the case there is no image available
> > or I want a colored background behind the image.
>
> - you can use background anc backgroundcolor at the same time
> - you can have multiple backgrounds

I know and I used a backgroundcolor and a background simultaneously
in my posted example but what I want is a interface in localframed without
the overlay solution, the background should also repeated horizontal and
vertical and not streched in both directions.

> \defineoverlay[one][\overlayfigure{name}]
> \defineoverlay[two][abcdef]
>
> \setupbackgrounds[page][background={one,two}]
>
> \setupbackgrounds[page][background={one,foreground,two}]
>
>
> etc
>
> > I have also a few wishes for \backgroundimage command in core-box,
> > is it possible let the graphics start in the left top corner and crop it only
> > at the ride side and at the bottom like the default bahaviour in html.
>
> i think that there is some code in the x-fo file for that
>
> > Shouldn't the \scratchbox in the \nextboxwd test be a \nextbox.
>
> where?

I meant in the \backgroundimage definition defined in core-box, bottom of the file).

\def\backgroundimage#1#2#3% repeat hsize vsize
  {\bgroup
   \dowithnextbox
     {\ifcase#1\relax
        % just one
      \else
        \scratchdimen#2\divide\scratchdimen\nextboxwd\count0\scratchdimen\advance\count0\plusone
        \scratchdimen#3\divide\scratchdimen\nextboxht\count2\scratchdimen\advance\count2\plusone
        % to be considered, probably methods
        \ifcase#1\or % x and y
          \setbox\nextbox\hbox{\dorecurse{\count0}{\copy\nextbox}}%
          \setbox\nextbox\vbox{\dorecurse{\count2}{\copy\nextbox\endgraf}}%
        \or % x
          \setbox\nextbox\hbox{\dorecurse{\count0}{\copy\nextbox}}%
        \or % y
          \setbox\nextbox\vbox{\dorecurse{\count2}{\copy\nextbox\endgraf}}%
        \fi
      \fi
      \ifdim\nextboxwd>#2\relax
        \setbox\nextbox\hbox to #2{\hss\flushnextbox\hss}%
        \setbox\scratchbox\hbox{\expanded{\clip[\c!width=#2,\c!height=\the\nextboxht]{\box\scratchbox}}}%
               ^^^^^^^^^^^                                                           ^^^^^^^^^^^^^^^
      \fi
      \ifdim\nextboxht>#3\relax
        \setbox\nextbox\vbox to #3{\vss\flushnextbox\vss}%
        \setbox\nextbox\hbox{\expanded{\clip[\c!width=\the\nextboxwd,\c!height=#3]{\flushnextbox}}}%
      \fi
      \flushnextbox
      \egroup}%
   \hbox}
 
I want to use this to provide the user in the second version of the go
module a command to use graphics as board backgrounds where he
can use at the moment only colors. I know I could wrap this myself
into a macro but I hoped I can this without own code and pass only the
figure name and the backgroundcolor to the setup command for page
backgrounds or the frame background.
 
Wolfgang