<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: Images in Matlab uicontrols &#038; labels	</title>
	<atom:link href="https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels/feed" rel="self" type="application/rss+xml" />
	<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=images-in-matlab-uicontrols-and-labels</link>
	<description>Professional Matlab consulting, development and training</description>
	<lastBuildDate>Sun, 09 Feb 2020 19:54:55 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		By: Iliya Romm		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-508203</link>

		<dc:creator><![CDATA[Iliya Romm]]></dc:creator>
		<pubDate>Sun, 09 Feb 2020 10:03:24 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-508203</guid>

					<description><![CDATA[To anybody attempting this in R2019b (and later?): unless you specify the image size, &lt;b&gt;nothing will be shown!&lt;/b&gt;. A solution is presented in &lt;a href=&quot;https://www.mathworks.com/matlabcentral/answers/497260-figure-uitable-does-not-display-html-image-in-2019b#answer_411812&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;this answer&lt;/a&gt;
&lt;pre lang=&quot;Matlab&quot;&gt;str = [&#039;&lt;html&gt;&lt;img src=&quot;file:/&#039; iconUrl &#039;&quot; height=&quot;16&quot; width=&quot;16&quot;&gt;&lt;/html&gt;&#039;];&lt;/pre&gt;]]></description>
			<content:encoded><![CDATA[<p>To anybody attempting this in R2019b (and later?): unless you specify the image size, <b>nothing will be shown!</b>. A solution is presented in <a href="https://www.mathworks.com/matlabcentral/answers/497260-figure-uitable-does-not-display-html-image-in-2019b#answer_411812" target="_blank" rel="nofollow">this answer</a></p>
<pre lang="Matlab">str = ['<html><img src="file:/' iconUrl '" height="16" width="16"/></html>'];</pre>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sneha		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410610</link>

		<dc:creator><![CDATA[Sneha]]></dc:creator>
		<pubDate>Fri, 21 Jul 2017 11:30:30 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-410610</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410592&quot;&gt;Sneha&lt;/a&gt;.

Hi, I am using MATLAB 2016 version]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410592">Sneha</a>.</p>
<p>Hi, I am using MATLAB 2016 version</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410608</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 21 Jul 2017 11:27:19 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-410608</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410606&quot;&gt;Sneha&lt;/a&gt;.

You need to use &lt;i&gt;&lt;b&gt;find&lt;u&gt;j&lt;/u&gt;obj&lt;/b&gt;&lt;/i&gt;, not &lt;i&gt;&lt;b&gt;findobj&lt;/b&gt;&lt;/i&gt;. Read the post (and the other articles on this blog) carefully.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410606">Sneha</a>.</p>
<p>You need to use <i><b>find<u>j</u>obj</b></i>, not <i><b>findobj</b></i>. Read the post (and the other articles on this blog) carefully.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sneha		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410606</link>

		<dc:creator><![CDATA[Sneha]]></dc:creator>
		<pubDate>Fri, 21 Jul 2017 11:23:30 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-410606</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410592&quot;&gt;Sneha&lt;/a&gt;.

Hi Yair,
Tried enlarging  my image and added empty space on top of the image and this worked. Thank you for the help. I wanted to align my text and tried using the following lines
&lt;pre lang=&quot;matlab&quot;&gt;
jButton = findobj(hObject);
jButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
but got an error stating:
No appropriate method, property, or field &#039;setVerticalAlignment&#039; for class &#039;matlab.ui.control.UIControl&#039;.

Error in MSCT&#062;pushbutton2_CreateFcn (line 812)
jButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in MSCT (line 44)
    gui_mainfcn(gui_State, varargin{:});

Error in
matlab.graphics.internal.figfile.FigFile/read&#062;@(hObject,eventdata)MSCT(&#039;pushbutton2_CreateFcn&#039;,hObject,eventdata,guidata(hObject))
&lt;/pre&gt;
Can you please help me with this.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410592">Sneha</a>.</p>
<p>Hi Yair,<br />
Tried enlarging  my image and added empty space on top of the image and this worked. Thank you for the help. I wanted to align my text and tried using the following lines</p>
<pre lang="matlab">
jButton = findobj(hObject);
jButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
but got an error stating:
No appropriate method, property, or field 'setVerticalAlignment' for class 'matlab.ui.control.UIControl'.

Error in MSCT&gt;pushbutton2_CreateFcn (line 812)
jButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in MSCT (line 44)
    gui_mainfcn(gui_State, varargin{:});

Error in
matlab.graphics.internal.figfile.FigFile/read&gt;@(hObject,eventdata)MSCT('pushbutton2_CreateFcn',hObject,eventdata,guidata(hObject))
</pre>
<p>Can you please help me with this.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410593</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Fri, 21 Jul 2017 07:14:12 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-410593</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410592&quot;&gt;Sneha&lt;/a&gt;.

@Sneha - either enlarge your image by adding empty space at the top, or use Java by accessing the &lt;a href=&quot;http://undocumentedmatlab.com/blog/button-customization&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;button&#039;s underlying Java control&lt;/a&gt; and then calling &lt;a href=&quot;https://docs.oracle.com/javase/7/docs/api/javax/swing/AbstractButton.html#setVerticalAlignment(int)&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;&lt;i&gt;setVerticalAlignment(javax.swing.SwingConstants.BOTTOM)&lt;/i&gt;&lt;/a&gt;.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410592">Sneha</a>.</p>
<p>@Sneha &#8211; either enlarge your image by adding empty space at the top, or use Java by accessing the <a href="http://undocumentedmatlab.com/blog/button-customization" target="_blank" rel="nofollow">button&#8217;s underlying Java control</a> and then calling <a href="https://docs.oracle.com/javase/7/docs/api/javax/swing/AbstractButton.html#setVerticalAlignment(int)" target="_blank" rel="nofollow"><i>setVerticalAlignment(javax.swing.SwingConstants.BOTTOM)</i></a>.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sneha		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410592</link>

		<dc:creator><![CDATA[Sneha]]></dc:creator>
		<pubDate>Fri, 21 Jul 2017 06:54:03 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-410592</guid>

					<description><![CDATA[Hi Yair 
I added image to my push button using the CData property but was not able to set its position.
The image added by  me is positioned at the center of the button by default. Is there any way to change its position to bottom of the push button]]></description>
			<content:encoded><![CDATA[<p>Hi Yair<br />
I added image to my push button using the CData property but was not able to set its position.<br />
The image added by  me is positioned at the center of the button by default. Is there any way to change its position to bottom of the push button</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410342</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Sun, 16 Jul 2017 16:27:39 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-410342</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410312&quot;&gt;Ronit&lt;/a&gt;.

@Ronit - you can update the button&#039;s &lt;b&gt;CData&lt;/b&gt; property. Read the Matlab documentation for the &lt;i&gt;&lt;b&gt;uicontrol&lt;/b&gt;&lt;/i&gt; function for details/examples.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410312">Ronit</a>.</p>
<p>@Ronit &#8211; you can update the button&#8217;s <b>CData</b> property. Read the Matlab documentation for the <i><b>uicontrol</b></i> function for details/examples.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Ronit		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-410312</link>

		<dc:creator><![CDATA[Ronit]]></dc:creator>
		<pubDate>Sun, 16 Jul 2017 07:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-410312</guid>

					<description><![CDATA[Do you know a way to show images on push buttons via GUIDE?
Thanks in advance!]]></description>
			<content:encoded><![CDATA[<p>Do you know a way to show images on push buttons via GUIDE?<br />
Thanks in advance!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yair Altman		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-409805</link>

		<dc:creator><![CDATA[Yair Altman]]></dc:creator>
		<pubDate>Thu, 06 Jul 2017 12:11:18 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-409805</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-409753&quot;&gt;Klaus&lt;/a&gt;.

@Klaus - not directly, but you can create a small image and add it to the button&#039;s &lt;b&gt;CData&lt;/b&gt;. As long as you don&#039;t resize the button too much in either direction, this should work nicely.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-409753">Klaus</a>.</p>
<p>@Klaus &#8211; not directly, but you can create a small image and add it to the button&#8217;s <b>CData</b>. As long as you don&#8217;t resize the button too much in either direction, this should work nicely.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Klaus		</title>
		<link>https://undocumentedmatlab.com/articles/images-in-matlab-uicontrols-and-labels#comment-409753</link>

		<dc:creator><![CDATA[Klaus]]></dc:creator>
		<pubDate>Wed, 05 Jul 2017 08:44:48 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=3177#comment-409753</guid>

					<description><![CDATA[Dear Yair,

thank you for the detailed description. Do you see a chance to put a 90 deg rotated text on a uicontrol (pushbutton)?

Best regars

Klaus]]></description>
			<content:encoded><![CDATA[<p>Dear Yair,</p>
<p>thank you for the detailed description. Do you see a chance to put a 90 deg rotated text on a uicontrol (pushbutton)?</p>
<p>Best regars</p>
<p>Klaus</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
