ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Henning Hraban Ramm <hraban@fiee.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: blurred shadow on images?
Date: Thu, 1 Jul 2010 10:58:16 +0200	[thread overview]
Message-ID: <8F7F9630-3588-4349-95D3-3095D4E01E39@fiee.net> (raw)
In-Reply-To: <4C2BAD7E.9090004@googlemail.com>

Am 2010-06-30 um 22:47 schrieb Wolfgang Schuster:

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

Thank you! I used an opaque picture for my tests.

I played a bit with different shapes, I like my rounded rectangle best:

\startuniqueMPgraphic{mpshadow}
ox := -7 ; % offset x
oy := -7 ; % offset y
bx := 5 ; % bleed x
by := 5 ; % bleed y
rx := 7 ; % corner radius x
ry := 7 ; % corner radius y
for dx = 0 upto 40:
	dy := dx ;
	xa := dx + ox - bx/2;
	xb := \overlaywidth - dx + ox + bx/2;
	ya := dy + oy - by/2;
	yb := \overlayheight - dy + oy + by/2;

%	% rectangle
%	fill (xa,ya)--(xb,ya)--(xb,yb)--(xa,yb)--cycle
%		withcolor transparent("normal", .04, black) ;

	% rounded rectangle
	fill (xa, ya + ry)---
		(xa, yb - ry)..
		(xa + rx, yb)---
		(xb - rx, yb)..
		(xb, yb - ry)---
		(xb, ya + ry)..
		(xb - rx, ya)---
		(xa + rx, ya)..cycle
		withcolor transparent("normal", .04, black) ;
	
%	% super ellipse
%	hx := xb / 2;
%	hy := yb / 2;
%	fill (xa + rx, ya + ry)...
%		(xa, ya + hy)...
%		(xa + rx, yb - ry)...
%		(xa + hx, yb)...
%		(xb - rx, yb - ry)...
%		(xb, ya + hy)...
%		(xb - rx, ya + ry)...
%		(xa + hx, ya)...cycle
%		withcolor transparent("normal", .04, black) ;
endfor;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic

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

\starttext

\rotate[rotation=12]{%
\externalfigure[koe][width=50mm,background=shadow]
}

\stoptext




Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

___________________________________________________________________________________
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-07-01  8:58 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
2010-07-01  8:58       ` Henning Hraban Ramm [this message]

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=8F7F9630-3588-4349-95D3-3095D4E01E39@fiee.net \
    --to=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).