Path: news.mathworks.com!not-for-mail
From: "Sven" <sven.holcombe@gmail.deleteme.com>
Newsgroups: comp.soft-sys.matlab
Subject: Adding text to bitmaps
Date: Tue, 6 Jan 2009 18:59:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 19
Message-ID: <gk09lo$4pn$1@fred.mathworks.com>
Reply-To: "Sven" <sven.holcombe@gmail.deleteme.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1231268344 4919 172.30.248.35 (6 Jan 2009 18:59:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 6 Jan 2009 18:59:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1326470
Xref: news.mathworks.com comp.soft-sys.matlab:510078


Hi there,

I'm trying to add custom text to each frame of a movie, as made from within matlab using getframe();

My problem is that I've already used getframe, so I'm working with an array of RGB bitmap images (rows x cols x 3), and trying to embed new text into them, therefore simply calling text() doesn't do what I want (ie, it just overlays vector text on top of the current figure).

How should I go about doing this?

Option 1: Add my text *before* I call getframe(). I would like to avoid this if possible, as I do some post-processing that works on blank regions where my text will go.

Option 2: Somehow change the RGB values of my image(s) directly

Option 3: Loop through my movie, show each frame in a new figure. Add my text using the text() command. Resave the image using getframe().

My problem with option 2, is that I don't know how to do it :(
My problem with option 3, is that when I open a new figure, my image is scaled according to the *figure*, but I want it to keep the same number of rows/cols when I call getframe() again.  How can I force an image to be displayed at one pixel per image pixel?

Thanks,
Sven.