ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Syed N Haider <syednaqihaider@gmail.com>
To: ntg-context@ntg.nl
Subject: Background using Image Overlay
Date: Mon, 7 Nov 2011 22:45:01 -0500	[thread overview]
Message-ID: <CAFy9bANEpWzA9Hr=4LO9t=yUkCoTrt=H7_Lqnm7JKbKny=4d2w@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1119 bytes --]

Hi All
I am new to the Metapost and Context world, and need some help regarding
the inclusion of Metapost graphics in ConTeXt documents. I am trying a very
simple approach, using a graphic as a background. Here's my sample (using a
very basic metapost graphic as a page background in a document):

Metapost:
========
beginfig(0);
theta := 360/7;
radius := 1in;
z0 = origin;
z1 = z0 + dir(90)*radius;
z2 = z0 + dir(90 + theta)*radius;
z3 = z0 + dir(90 + 2*theta)*radius;
z4 = z0 + dir(90 + 3*theta)*radius;
z5 = z0 + dir(90 + 4*theta)*radius;
z6 = z0 + dir(90 + 5*theta)*radius;
z7 = z0 + dir(90 + 6*theta)*radius;
draw z1 -- z2 -- z3 -- z4 -- z5 -- z6 -- z7
-- cycle;
endfig;
end;



ConTeXt (after running mpost on the metapost graphic to generate  the
hexagon.0 file):
=====================================================================

\defineoverlay
[backg]
[{\externalfigure[hexagon.0][width=\overlaywidth,height=\overlayheight]}]

\starttext
\noheaderandfooterlines
\setupbackgrounds[page][background=backg]
%\placefigure
%{none}
%{\externalfigure[hexagon.0][width=12cm]}
\stoptext




Thanks in advance

Syed

[-- Attachment #1.2: Type: text/html, Size: 1662 bytes --]

[-- Attachment #2: 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
___________________________________________________________________________________

             reply	other threads:[~2011-11-08  3:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-08  3:45 Syed N Haider [this message]
2011-11-08  5:31 ` Wolfgang Schuster

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='CAFy9bANEpWzA9Hr=4LO9t=yUkCoTrt=H7_Lqnm7JKbKny=4d2w@mail.gmail.com' \
    --to=syednaqihaider@gmail.com \
    --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).