[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Converting a page of text into a bitmap



>Dear MacPerl-gurus,
>
>I've written a script which I use to convert between a propriety
>graphics format (Biorad confocal microscope files) and multilayer
>Photoshop files.
>
>The script works OK but is pretty slow, and one of the slowest bits
>is the assembly of an 'information layer' that I put in the
>background layer of the photoshop file.
>
>Basically, what I need to do is convert a bunch of text into a
>bitmap.

Recently we had a discussion on this list with the subject "[MacPerl]
Screen capture". My suggestion was to use Keyquencer's "CopyScreen"
command. If the PICT format will work for you this might help. Quoting from
my response to that question...
  "include a KeyQuencer script within your MacPerl script
   (kinda like you do with Applescript) that could do the capture using
   KeyQuencer's 'CopyScreen' command. By default it copies to the clipboard
   but it also allows for copying to a PICT file. You can specify that the
   whole screen be copied or just the frontmost window, or have KeyQuencer
   prompt you to make a rectangular selection with your mouse, or you can
   include the specific rectangular coordinates in your code."


KeyQuencer is from Binary Software
  http://www.binarysoft.com/kqmac/kqmac.html.

>From KeyQuencer's Command Help...
"CopyScreen"
Takes a screen shot of the selected area and saves it to the clipboard or
to a PICT file.

CopyScreen [selection/window/screen/(#L #T #R #B)] [file]

*  selection = Lets you use the mouse to select a rectangular area to
capture (default).
*  window = Takes a screen shot of the frontmost window.
*  screen = Takes a screen shot of the Mac's main screen.
*  #L #T #R #B = Copy a specific rectangular area with L = left, T = top, R
= right and B = bottom coordinates.
*  file = Instead of copying the selected screen image to the clipboard, it
saves it to a 'PICT' file named Screen Image 1, 2, 3Š on the root level of
the system disk.


Sample MacPerl code with embeded Keyquencer command to capture screen to
clipboard (could be easily modified to save to PICT file by adding path
info)...
------------------------------------------------

#!perl5

package Whatever;

&MacPerl::LoadExternals("KQ.XFCN");

$kqMacro = <<"EOF";
 SwitchApp "Eudora Light" partial
 WaitUpdates
 CopyScreen window

EOF

  &Whatever::KQMacro($kqMacro);
  while (&Whatever::KQRunning()) {}();
  sleep(1);

__END__


David Seay
http://www.mastercall.com/g-s/




# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org