[NTG-context] resize and center and clip image

2014-05-01 Thread Mikael P. Sundqvist
Hi! Assume that I want to fill in the text area with images, and I want to clip and scale them according to these rules: 1) If the image is too wide (in sense of proportions), then scale it so that the height fits the text area height, center it, and clip it to the text area. (See the attached

Re: [NTG-context] resize and center and clip image

2014-05-01 Thread Mikael P. Sundqvist
OK, sorry for the noise. I think I have the solution: \startexternalfigurecollection[k.jpg] \useexternalfigure[k.jpg][k.jpg] \stopexternalfigurecollection \externalfigurecollectionminwidth{k.jpg} \externalfigurecollectionmaxheight{k.jpg} \clip[width=8cm,height=7cm]{% \framed[width=8cm

Re: [NTG-context] resize and center and clip image

2014-05-01 Thread Otared Kavian
/Context/essais/mkii/figures/resize-and-center.tex: ! Undefined control sequence \startexternalfigurecollection ...igurecollection {#1}\settrue \c_grph_inclu... l.13 \clip[width=8cm,height=7cm] {% 3

Re: [NTG-context] resize and center and clip image

2014-05-01 Thread Mikael P. Sundqvist
]) context(\\hskip%ssp, skalning) context.externalfigure({str},{height=hojd}) context.sprint(bar) end end \stopluacode \unexpanded\def\lundklippfyllbild#1#2#3{% \startexternalfigurecollection[#1]% \useexternalfigure[#1][#1]% \stopexternalfigurecollection% \clip[ width=#2, height=#3, hoffset

Re: [NTG-context] resize and center and clip image

2014-05-01 Thread Otared Kavian
},{height=hojd}) context.sprint(bar) end end \stopluacode \unexpanded\def\lundklippfyllbild#1#2#3{% \startexternalfigurecollection[#1]% \useexternalfigure[#1][#1]% \stopexternalfigurecollection% \clip[ width=#2, height=#3, hoffset=0mm, voffset=0mm, ]{% \framed[width=#2,height=#3

Re: [NTG-context] resize and center and clip image

2014-05-01 Thread Aditya Mahajan
end \stopluacode \unexpanded\def\lundklippfyllbild#1#2#3{% \startexternalfigurecollection[#1]% \useexternalfigure[#1][#1]% \stopexternalfigurecollection% \clip[ width=#2, height=#3, hoffset=0mm, voffset=0mm, ]{% \framed[width=#2,height=#3,align={middle,lohi},offset=overlay,frame=off]{% \dimen0

Re: [NTG-context] resize and center and clip image

2014-05-01 Thread Mikael P. Sundqvist
, skalning) context.externalfigure({str},{height=hojd}) context.sprint(bar) end end \stopluacode \unexpanded\def\lundklippfyllbild#1#2#3{% \startexternalfigurecollection[#1]% \useexternalfigure[#1][#1]% \stopexternalfigurecollection% \clip[ width=#2, height=#3, hoffset=0mm

Re: [NTG-context] resize and center and clip image

2014-05-01 Thread Wolfgang Schuster
) context.externalfigure({str},{height=hojd}) context.sprint(bar) end end \stopluacode \unexpanded\def\lundklippfyllbild#1#2#3{% \startexternalfigurecollection[#1]% \useexternalfigure[#1][#1]% \stopexternalfigurecollection% \clip[ width=#2, height=#3, hoffset=0mm, voffset=0mm

[NTG-context] Clip and framed not precise in MKIV

2011-09-21 Thread Otso Helenius
Hi, I've used ConTeXt to chop up a big map svg on separate A4 papers like this: \setuplayout[width=190mm,backspace=10mm,height=297mm,topspace=10mm, header=0mm] \setupclipping[nx=3,ny=3] \starttext \dorecurse{3}{\framed{\clip[x=\recurselevel,y=1]{\externalfigure[map.svg][width=570mm

Re: [NTG-context] Clip and framed not precise in MKIV

2011-09-21 Thread Peter Rolf
Am 21.09.2011 14:26, schrieb Otso Helenius: Hi, I've used ConTeXt to chop up a big map svg on separate A4 papers like this: \setuplayout[width=190mm,backspace=10mm,height=297mm,topspace=10mm, header=0mm] \setupclipping[nx=3,ny=3] \starttext \dorecurse{3}{\framed{\clip[x=\recurselevel

Re: [NTG-context] Trying to get figure frame corners to clip figure

2011-07-07 Thread Kip Warner
On Thu, 2011-07-07 at 07:35 +0200, Wolfgang Schuster wrote: There is a example in the metafun manual: http://pragma-ade.com/show-man-7.htm Wolfgang Wolfgang, I appreciate the effort, but you've linked me to a 657 page manual which is totally useless to me. I don't have time to learn another

[NTG-context] Trying to get figure frame corners to clip figure

2011-07-06 Thread Kip Warner
Hey list, I'd like the rounded corners of my figure's frame to clip off the outside corners of the image so they aren't sticking out. This is what I'm making do with: \setupexternalfigures [frame=on, corner=25, framecolor=colour_frame_border, background=color, backgroundcolor

Re: [NTG-context] Trying to get figure frame corners to clip figure

2011-07-06 Thread Aditya Mahajan
On Wed, 6 Jul 2011, Kip Warner wrote: Hey list, I'd like the rounded corners of my figure's frame to clip off the outside corners of the image so they aren't sticking out. This is what I'm making do with: \setupexternalfigures [frame=on, corner=25, framecolor=colour_frame_border

Re: [NTG-context] Trying to get figure frame corners to clip figure

2011-07-06 Thread Kip Warner
On Wed, 2011-07-06 at 23:48 -0400, Aditya Mahajan wrote: You can use \clip[mp=...]{\framed[...]{...}} (I think that the metafun manual gives an example). Aditya Thanks Aditya, I'll look into it. I searched both the reference and tutorial pdf and there is no description of \clip, but I

Re: [NTG-context] Trying to get figure frame corners to clip figure

2011-07-06 Thread Kip Warner
On Wed, 2011-07-06 at 23:48 -0400, Aditya Mahajan wrote: You can use \clip[mp=...]{\framed[...]{...}} (I think that the metafun manual gives an example). Aditya Aditya, correct me if wrong, but it looks like \clip performs rectangular clipping only? As I mentioned earlier, I'd like

Re: [NTG-context] Trying to get figure frame corners to clip figure

2011-07-06 Thread Wolfgang Schuster
Am 07.07.2011 um 07:18 schrieb Kip Warner: On Wed, 2011-07-06 at 23:48 -0400, Aditya Mahajan wrote: You can use \clip[mp=...]{\framed[...]{...}} (I think that the metafun manual gives an example). Aditya Aditya, correct me if wrong, but it looks like \clip performs rectangular

[NTG-context] Using text as a clip path for Metafun free shape paragraphs

2011-05-22 Thread Otso Helenius
:= currentpicture; currentpicture := nullpicture; fill unitsquare xysized (100mm,100mm) withcolor blue; path mask; mask := unitsquare xysized (100mm,100mm) -- reverse unitsquare xysized (100mm,10mm) shifted (0mm,45mm) -- cycle; clip cur to mask; draw cur; \stopMPcode But I can't cut pictures

Re: [NTG-context] Using text as a clip path for Metafun free shape paragraphs

2011-05-22 Thread Hans Hagen
On 22-5-2011 5:09, Otso Helenius wrote: With this feature one could define for example a 2-page spread for a magazine (with free shape graphics and columns) in between two ordinarily defined pages and would not have to manually disrupt the body text flow through the document. It can

Re: [NTG-context] problem with mp clip

2007-07-23 Thread Peter Rolf
Patrick Gundlach schrieb: Is there a way to add the test pictures (cont-img.zip) to 'live context'? They are already installed, but not in a local path. I have changed 'live context' so now the sample figures are in the search path. Patrick Thanks Patrick! This makes life easier :)

Re: [NTG-context] problem with mp clip

2007-07-23 Thread Peter Rolf
Hans Hagen schrieb: Peter Rolf wrote: Hi, it seems, that clipping with a MetaPost path is broken (at least on my machine). I couldn't test it on Contextgarden, as the standard example pictures are not installed (or the !!path is not searched). Anyhow, if someone can test this please.

[NTG-context] problem with mp clip

2007-07-22 Thread Peter Rolf
), ConTeXt beta from 03.07.2007, pdftex 1.40.4 and mpost 1.0. Thanks in advance, Peter @Patrick: Is there a way to add the test pictures (cont-img.zip) to 'live context'? \setupcolors[state=start] \setuppagenumber[state=stop] \startMPclip{ClipTest} clip currentpicture to unitcircle scaled

Re: [NTG-context] problem with mp clip

2007-07-22 Thread Patrick Gundlach
Is there a way to add the test pictures (cont-img.zip) to 'live context'? They are already installed, but not in a local path. I have changed 'live context' so now the sample figures are in the search path. Patrick

Re: [NTG-context] problem with mp clip

2007-07-22 Thread Hans Hagen
Peter Rolf wrote: Hi, it seems, that clipping with a MetaPost path is broken (at least on my machine). I couldn't test it on Contextgarden, as the standard example pictures are not installed (or the !!path is not searched). Anyhow, if someone can test this please. has to do with the

[NTG-context] clip bug?

2005-05-28 Thread Vit Zyka
Dear Hans, it seems to me that \clip was extended by the useful params left|right|top|bottomoffset. But they do not work: \starttext \clip [leftoffset=1cm,rightoffset=1cm,topoffset=2cm,bottomoffset=.5cm] {\externalfigure[cow]} \stoptext Thanks Vit