ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Cc: Henning Hraban Ramm <hraban@fiee.net>
Subject: Re: blurred shadow on images?
Date: Wed, 30 Jun 2010 22:47:58 +0200	[thread overview]
Message-ID: <4C2BAD7E.9090004@googlemail.com> (raw)
In-Reply-To: <2AB09333-C25D-4034-865C-B5A4557B6193@fiee.net>

Am 30.06.10 14:39, schrieb Henning Hraban Ramm:
> Am 2010-06-21 um 08:42 schrieb Taco Hoekwater:
>> Creating a semi-transparent backdrop with metapost is quite simple,
>> but I am not sure whether that works with cmyk, you'll have to try
>> yourself. Code goes something like this:
>
> For the records: This is, how I'll use it:
>
> \startuniqueMPgraphic{texthole}
> for dx = 0 upto 40:
>      dy := dx;
>      wa := 10 + dx;
>      wb := \overlaywidth - dx - 10;
>      ha := dy + 10;
>      hb := \overlayheight - dy - 10;
>      fill (wa,ha)--(wb,ha)--(wb,hb)--(wa,hb)--cycle
>         withcolor transparent("normal", .04, black);
> endfor;
> \stopuniqueMPgraphic
>
> \defineoverlay[shaded][\useMPgraphic{texthole}]
>
> \starttext
>
> \rotate[rotation=12]{%
> \framed[height=50mm, width=50mm, frame=off, background=shaded, 
> backgroundoffset=5mm, align=middle]%
> {\offset[x=1mm,y=-2mm]{\externalfigure[koe][width=50mm]}}%
> }
>
> \stoptext
>
> I'm glad I found \offset, because framed's offset parameter can't 
> distinguish x and y offset.
> Positive offset moves right and down, negative offset moves just up - 
> I guess that's a buglet.

You can change the boundingbox in the metapost graphic (the white 
background was required
for the cow figure because it has a transparent background)

\startuniqueMPgraphic{shadow}
for dx = 0 upto 40:
      dy := dx ;
      wa := dx - 10 ;
      wb := \overlaywidth - dx + 10 ;
      ha := dy - 10 ;
      hb := \overlayheight - dy + 10 ;
      fill (wa,ha)--(wb,ha)--(wb,hb)--(wa,hb)--cycle
         withcolor transparent("normal", .04, black);
endfor;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic

\defineoverlay[shadow][\useMPgraphic{shadow}]

\starttext
\externalfigure[cow][width=50mm,background={shadow,color},backgroundcolor=white]
\stoptext

Wolfgang

___________________________________________________________________________________
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
___________________________________________________________________________________


  reply	other threads:[~2010-06-30 20:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-20 13:37 Henning Hraban Ramm
2010-06-21  6:42 ` Taco Hoekwater
2010-06-22 20:58   ` Henning Hraban Ramm
2010-06-30 12:39   ` Henning Hraban Ramm
2010-06-30 20:47     ` Wolfgang Schuster [this message]
2010-07-01  8:58       ` Henning Hraban Ramm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C2BAD7E.9090004@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=hraban@fiee.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).