matprint
Prints (rasterizes) text directly to image matrix.
Author: Karel Lebeda
Position is in format [x;y] and they're by default coordinates of the upper left corner; that can be changed by alignment options. Currently, the only font format it takes is my 'special' one... I thought about making it load some common type, or at least create some font(s) in this format (100 characters is not so much...).
Btw, if raster format with fixed font size is enough for you, I can recommend this: http://www.mathworks.co.kr/matlabcentral/fileexchange/26940-render-rgb-text-over-rgb-or-grayscale-image
Thanks a lot!
Anyway, I have one suggestion: it doesn't turn the colouring back off unless at the end of line, e.g.:
cprintf('r', 'aaa'); fprintf('bbb')
prints everything in red...
Position is in format [x;y] and they're by default coordinates of the upper left corner; that can be changed by alignment options. Currently, the only font format it takes is my 'special' one... I thought about making it load some common type, or at least create some font(s) in this format (100 characters is not so much...).
Btw, if raster format with fixed font size is enough for you, I can recommend this: http://www.mathworks.co.kr/matlabcentral/fileexchange/26940-render-rgb-text-over-rgb-or-grayscale-image
11 Mar 2013
matprint
Prints (rasterizes) text directly to image matrix.
Author: Karel Lebeda
Sébastien - you are using cprintf incorrectly. Firstly, the extra parameter 4 has no meaning since you are not using any printf fields (e.g. %d) in your string.
Secondly, you don't need (and actually should not use) \r - \r clears the current line to the beginning on some systems, which could explain what you are seeing.
Thanks for your code.
It works well with Matlab 2007 but colors are not displayed on my computer with Matlab 2012b.
The text is displayed but in white in fact.
If I write cprintf('k','test\r\n', 4), the line is written in white with a blue "-" before the string
If I write cprintf('-k','test\r\n', 4), text is displayed in blue and underscored with a blue "-" before the string.
Could you help me please?
4
12 Mar 2013
matprint
Prints (rasterizes) text directly to image matrix.
Position is in format [x;y] and they're by default coordinates of the upper left corner; that can be changed by alignment options. Currently, the only font format it takes is my 'special' one... I thought about making it load some common type, or at least create some font(s) in this format (100 characters is not so much...).
Btw, if raster format with fixed font size is enough for you, I can recommend this: http://www.mathworks.co.kr/matlabcentral/fileexchange/26940-render-rgb-text-over-rgb-or-grayscale-image
Comment only
11 Mar 2013
matprint
Prints (rasterizes) text directly to image matrix.
Comment only