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. 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. Shouldn't the \scratchbox in the \nextboxwd test be a \nextbox. Wolfgang
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 \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? ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Wolfgang Schuster wrote:
Hi Hans,
can you provide a backgroundimage key for localframed (ot use it in
and fastlocalframed (to use it in \setupbackgrounds) to create something
2007/10/11, Hans Hagen
\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
Wolfgang Schuster wrote:
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[image][\backgroundimage1\overlaywidth\overlayheight{\externalfigure[\framedparameter{backgroundimage}]}] \framed[width=15cm,height=25cm,backgroundimage=cow.pdf,background=image]{test} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Thu, 11 Oct 2007, Hans Hagen wrote:
Wolfgang Schuster wrote:
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[image][\backgroundimage1\overlaywidth\overlayheight{\externalfigure[\framedparameter{backgroundimage}]}]
\framed[width=15cm,height=25cm,backgroundimage=cow.pdf,background=image]{test}
Wow, I never thought of this before. This is a really nice way to generate and use key-value pairs on the fly. Aditya
Aditya Mahajan wrote:
On Thu, 11 Oct 2007, Hans Hagen wrote:
Wolfgang Schuster wrote:
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[image][\backgroundimage1\overlaywidth\overlayheight{\externalfigure[\framedparameter{backgroundimage}]}]
\framed[width=15cm,height=25cm,backgroundimage=cow.pdf,background=image]{test}
Wow, I never thought of this before. This is a really nice way to generate and use key-value pairs on the fly.
whenever i see a reason i provide a \xxxparameter now, but beware of potential clashes, i can imagine prefixes in some cases, \framed[width=15cm,height=25cm,x:backgroundimage=cow.pdf,background=image]{test} Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
2007/10/11, Hans Hagen
Wolfgang Schuster wrote:
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[image][\backgroundimage1\overlaywidth\overlayheight{\externalfigure[\framedparameter{backgroundimage}]}]
\framed[width=15cm,height=25cm,backgroundimage=cow.pdf ,background=image]{test}
Hi Hans, nearly perfect but can I also test if the requested figure did really exist with something like \doiffigure{\framedparameter{backgroundimage}}{\backgroundimage{...}}. I hope there will be a hidden feature section in the ConTeXtbook with all of ConTeXt's little features I don't know at the moment. Wolfgang
Wolfgang Schuster wrote:
2007/10/11, Hans Hagen
: Wolfgang Schuster wrote:
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[image][\backgroundimage1\overlaywidth\overlayheight{\externalfigure[\framedparameter{backgroundimage}]}]
\framed[width=15cm,height=25cm,backgroundimage=cow.pdf ,background=image]{test}
Hi Hans,
nearly perfect but can I also test if the requested figure did really exist with something like \doiffigure{\framedparameter{backgroundimage}}{\backgroundimage{...}}.
I hope there will be a hidden feature section in the ConTeXtbook with all of ConTeXt's little features I don't know at the moment. \starttext
\def\doiffigureelse#1% {\getfiguredimensions[#1]% \ifcase\figurewidth \expandafter\secondoftwoarguments \else \expandafter\firstoftwoarguments \fi} \doiffigureelse{cow.pdf}{yes}{no} \doiffigureelse{xxx.pdf}{no}{yes} \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Aditya Mahajan
-
Hans Hagen
-
Wolfgang Schuster