ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* resize and center and clip image
@ 2014-05-01 11:50 Mikael P. Sundqvist
  2014-05-01 13:38 ` Mikael P. Sundqvist
  0 siblings, 1 reply; 8+ messages in thread
From: Mikael P. Sundqvist @ 2014-05-01 11:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

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 image, on top, where the blue area
is supposed to show the text area and the red rectangle the image.)

2) If the image is "too high" (in sense of proportions), then scale it
so that the width fits the text area width, center it, and clip it to
the text area. (See the attached image, on bottom.)

The background why I want to do this is that I'm making a small
template for presentations, and I'd like the users to insert images as
background without really having to think about if their proportions
fit or not.

Best regards, Mikael

[-- Attachment #2: contextresizecenter.png --]
[-- Type: image/png, Size: 8957 bytes --]

[-- Attachment #3: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-05-01 19:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-01 11:50 resize and center and clip image Mikael P. Sundqvist
2014-05-01 13:38 ` Mikael P. Sundqvist
2014-05-01 14:59   ` Otared Kavian
2014-05-01 15:07     ` Mikael P. Sundqvist
2014-05-01 16:43       ` Otared Kavian
2014-05-01 18:00       ` Aditya Mahajan
2014-05-01 19:27         ` Mikael P. Sundqvist
2014-05-01 19:31         ` Wolfgang Schuster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).