text image in matlab without using getframe

1 view (last 30 days)
Hi, I would like to create a text image in matlab, so to say write a text and save it as an image. I have already managed to implement this by the following steps,
1) Creating a new figure and create an image in the figure.
2) Type in some text using the "text" function.
3) Since text only creates text in one pixel (the text looks larger, though the text data is only located in one pixel. The scaling is external and not a part of the image), I use getframe to take a screenshot of the frame.
4) Close the figure and extract frame data from the output of getframe.
5) Extract the desired part of the frame and discards the rest, create a new figure with desired data and save it.
The method works fine except for in step 3). The problem is that get frame takes a screenshot of the current axis. This makes the whole method unstable since the a screenshot only captures what is on the screen. If I do other work on the computer on the same time, this may appear in the image instead of the expected text. I do not have the "Computer Vision System Toolbox" so I cannot use insertText. Are there any other ways to do this that does not require getframe?
Thankful for answer, Patrik
  1 Comment
Walter Roberson
Walter Roberson on 3 Feb 2014
I believe there is a File Exchange contribution that can do this.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!