Path: news.mathworks.com!not-for-mail
From: "Bryan " <cssmwbs@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Printing an image to scale
Date: Thu, 3 Apr 2008 16:57:12 +0000 (UTC)
Organization: Nativis Inc
Lines: 45
Message-ID: <ft3298$gsv$1@fred.mathworks.com>
References: <ft1nph$5rv$1@fred.mathworks.com> <ft1ruq$mct$1@fred.mathworks.com> <ft2q66$aj8$1@fred.mathworks.com> <ft312h$49e$1@fred.mathworks.com>
Reply-To: "Bryan " <cssmwbs@gmail.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1207241832 17311 172.30.248.38 (3 Apr 2008 16:57:12 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 3 Apr 2008 16:57:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 291118
Xref: news.mathworks.com comp.soft-sys.matlab:460875



"Steven Lord" <slord@mathworks.com> wrote in message
<ft312h$49e$1@fred.mathworks.com>...
> 
> "Joshua Fialkoff" <fialkj@rpi.edu> wrote in message 
> news:ft2q66$aj8$1@fred.mathworks.com...
> > Thanks for the help.  I don't think this is accomplishing
> > what I'm looking for.  I performed the following:
> >
> > img = imread('somefile.tif');
> > imshow(img);
> > rectangle('position', [0 0 100 100]);
> > img2 = get(findobj('type','image'), 'cdata');
> > imshow(img2);
> >
> > The result is the original image.  What I desire is a
> > composite image (i.e., an image that is somefile.tif with a
> > square overlaid).
> 
> You might want to look at the GETFRAME or PRINT functions.
 [PRINT to an 
> image file, then read in the image to get the modified
data back into 
> MATLAB.]
> 
> -- 
> Steve Lord
> slord@mathworks.com 
> 

but if the image is displayed at anything other than 100%
this loses the original image dimensions... i think the op
wanted the _same_ image (dimensions), with the modifications
as part of the new image.  

after looking around myself, i have also had trouble finding
this functionality.  i tried to set the rectangle's parent
property to be the image, but that didn't work out.

in the trivial example given, the op could obviously just
change the color of the pixels in his original image that
define his rectangle, but this would get harder and harder
for non-simple annotations (and text!).

bryan