<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Showing a different jpg image depending on a result (MathCAD 15.0) in Mathcad</title>
    <link>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790757#M200729</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/213621"&gt;@ClaudioPedrazzi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I would like to show a different jpg image depending on a certain result.&lt;/P&gt;
&lt;P&gt;Say for example that I have three sketches, saved in the active directory:&lt;/P&gt;
&lt;P&gt;sketchA.jpg&lt;/P&gt;
&lt;P&gt;sketchB.jpg&lt;/P&gt;
&lt;P&gt;sketchC.jpg&lt;/P&gt;
&lt;P&gt;The three sketches have similar but not perfectly identical pixel number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I perform a certain calculation, that e.g. produces &lt;STRONG&gt;x&lt;/STRONG&gt; as a result.&lt;/P&gt;
&lt;P&gt;Is it possible, using for example a conditional READ_IMAGE(), to let appear e.g. sketchA if x&amp;lt;=0, sketchB if 0&amp;lt;x&amp;lt;1 and sketchC if x&amp;gt;=1 ?&lt;/P&gt;
&lt;P&gt;I am actually using MathCAD 15.0.&amp;nbsp; But would this functionality be available also in MathCAD Prime?&lt;/P&gt;
&lt;P&gt;How would you implement this functionality?&lt;/P&gt;
&lt;P&gt;Thanks a lot for any hint&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Claudio&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, it's straightforward in Mathcad 15 - indeed, there are several ways to skin the selection cat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, I don't have Mathcad 15 so can't give a programmed example, but the following Mathcad Prime example should work in M15.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022 04 19 a.png" style="width: 465px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/56009i7336C0C65AE4DE99/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022 04 19 a.png" alt="2022 04 19 a.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You insert a Picture operator into your worksheet and type &lt;STRONG&gt;img(x)&lt;/STRONG&gt; into the placeholder.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for Prime, ... in one of the more annoying exclusions (&lt;EM&gt;I've complained about since Prime 1&lt;/EM&gt;), it is not possible to load an arbitrary image into a worksheet.&amp;nbsp; &amp;nbsp;That capability is a candidate for some future version of Prime, according to the last published roadmap.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/PTC-Mathcad/PTC-Mathcad-Prime-Roadmap-2021-update/m-p/738684" target="_blank"&gt;https://community.ptc.com/t5/PTC-Mathcad/PTC-Mathcad-Prime-Roadmap-2021-update/m-p/738684&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 12:30:00 GMT</pubDate>
    <dc:creator>StuartBruff</dc:creator>
    <dc:date>2022-04-19T12:30:00Z</dc:date>
    <item>
      <title>Showing a different jpg image depending on a result (MathCAD 15.0)</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790749#M200728</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I would like to show a different jpg image depending on a certain result.&lt;/P&gt;&lt;P&gt;Say for example that I have three sketches, saved in the active directory:&lt;/P&gt;&lt;P&gt;sketchA.jpg&lt;/P&gt;&lt;P&gt;sketchB.jpg&lt;/P&gt;&lt;P&gt;sketchC.jpg&lt;/P&gt;&lt;P&gt;The three sketches have similar but not perfectly identical pixel number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I perform a certain calculation, that e.g. produces &lt;STRONG&gt;x&lt;/STRONG&gt; as a result.&lt;/P&gt;&lt;P&gt;Is it possible, using for example a conditional READ_IMAGE(), to let appear e.g. sketchA if x&amp;lt;=0, sketchB if 0&amp;lt;x&amp;lt;1 and sketchC if x&amp;gt;=1 ?&lt;/P&gt;&lt;P&gt;I am actually using MathCAD 15.0.&amp;nbsp; But would this functionality be available also in MathCAD Prime?&lt;/P&gt;&lt;P&gt;How would you implement this functionality?&lt;/P&gt;&lt;P&gt;Thanks a lot for any hint&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Claudio&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 12:10:11 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790749#M200728</guid>
      <dc:creator>ClaudioPedrazzi</dc:creator>
      <dc:date>2022-04-19T12:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Showing a different jpg image depending on a result (MathCAD 15.0)</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790757#M200729</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/213621"&gt;@ClaudioPedrazzi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I would like to show a different jpg image depending on a certain result.&lt;/P&gt;
&lt;P&gt;Say for example that I have three sketches, saved in the active directory:&lt;/P&gt;
&lt;P&gt;sketchA.jpg&lt;/P&gt;
&lt;P&gt;sketchB.jpg&lt;/P&gt;
&lt;P&gt;sketchC.jpg&lt;/P&gt;
&lt;P&gt;The three sketches have similar but not perfectly identical pixel number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I perform a certain calculation, that e.g. produces &lt;STRONG&gt;x&lt;/STRONG&gt; as a result.&lt;/P&gt;
&lt;P&gt;Is it possible, using for example a conditional READ_IMAGE(), to let appear e.g. sketchA if x&amp;lt;=0, sketchB if 0&amp;lt;x&amp;lt;1 and sketchC if x&amp;gt;=1 ?&lt;/P&gt;
&lt;P&gt;I am actually using MathCAD 15.0.&amp;nbsp; But would this functionality be available also in MathCAD Prime?&lt;/P&gt;
&lt;P&gt;How would you implement this functionality?&lt;/P&gt;
&lt;P&gt;Thanks a lot for any hint&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Claudio&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, it's straightforward in Mathcad 15 - indeed, there are several ways to skin the selection cat.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately, I don't have Mathcad 15 so can't give a programmed example, but the following Mathcad Prime example should work in M15.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2022 04 19 a.png" style="width: 465px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/56009i7336C0C65AE4DE99/image-size/large?v=v2&amp;amp;px=999" role="button" title="2022 04 19 a.png" alt="2022 04 19 a.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You insert a Picture operator into your worksheet and type &lt;STRONG&gt;img(x)&lt;/STRONG&gt; into the placeholder.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for Prime, ... in one of the more annoying exclusions (&lt;EM&gt;I've complained about since Prime 1&lt;/EM&gt;), it is not possible to load an arbitrary image into a worksheet.&amp;nbsp; &amp;nbsp;That capability is a candidate for some future version of Prime, according to the last published roadmap.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.ptc.com/t5/PTC-Mathcad/PTC-Mathcad-Prime-Roadmap-2021-update/m-p/738684" target="_blank"&gt;https://community.ptc.com/t5/PTC-Mathcad/PTC-Mathcad-Prime-Roadmap-2021-update/m-p/738684&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 12:30:00 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790757#M200729</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2022-04-19T12:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Showing a different jpg image depending on a result (MathCAD 15.0)</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790770#M200730</link>
      <description>&lt;P&gt;Hi Stuart&lt;/P&gt;&lt;P&gt;thanks a lot!&lt;/P&gt;&lt;P&gt;it seems to work similarly also in MathCAD 15.0 (using &lt;STRONG&gt;READ_IMAGE&lt;/STRONG&gt; or &lt;STRONG&gt;READRGB&lt;/STRONG&gt;), the only problem is, notwithstanding the statement in the help, that "&lt;EM&gt;recognized image formats are&amp;nbsp;BMP, GIF, JPG, PCX, or TGA&lt;/EM&gt;.", I was able to get the wished result only using GIF. Actually I would like to use jpg.&amp;nbsp; But I get the message &lt;FONT color="#FF0000"&gt;"&lt;STRONG&gt;unknown file format&lt;/STRONG&gt;"&lt;/FONT&gt; with .jpg and .JPG too.&lt;/P&gt;&lt;P&gt;Does some user know how to read JPG files in MathCAD 15.0?&lt;/P&gt;&lt;P&gt;Thanks a lot again&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Claudio&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 13:04:07 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790770#M200730</guid>
      <dc:creator>ClaudioPedrazzi</dc:creator>
      <dc:date>2022-04-19T13:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Showing a different jpg image depending on a result (MathCAD 15.0)</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790791#M200731</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Mathcad 15 is older software so has not kept up with advances in the jpeg format.&lt;/P&gt;
&lt;P&gt;The enclosed photo of a guitar was taken with an Ipad to jpg format.&lt;/P&gt;
&lt;P&gt;It has been scaled down in GIMP so can be uploaded here.&lt;/P&gt;
&lt;P&gt;I use the free photo editor GIMP to remove the modern color profile.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.gimp.org/downloads/" target="_blank" rel="noopener"&gt;https://www.gimp.org/downloads/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure but it may be possible to open the modern jpg with the default photo editor in windows and simply Save As a new jpg.&amp;nbsp; This may also get rid of modern color profiles&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-04-20 000052.JPG" style="width: 336px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/56018i57B5706FCCA91AB9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-04-20 000052.JPG" alt="Screenshot 2022-04-20 000052.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 14:14:12 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790791#M200731</guid>
      <dc:creator>terryhendicott</dc:creator>
      <dc:date>2022-04-19T14:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Showing a different jpg image depending on a result (MathCAD 15.0)</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790882#M200741</link>
      <description>&lt;P&gt;Hi Stuart and Terry,&lt;/P&gt;&lt;P&gt;thanks for the hints.&amp;nbsp; For some reason I didn't manage to obtain stable results with jpg. Some images (color and b/w) were readable, other not! Of course all of them were made with the same tool, namely the "Snipping Tool" of Windows, and about the same pixel dimensions.&lt;/P&gt;&lt;P&gt;The GIF format seemed to work better.&amp;nbsp; So my actual solution looks like this, in the most simple form:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Unbenannt.PNG" style="width: 378px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/56045i69CB18C24E89B30F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Unbenannt.PNG" alt="Unbenannt.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;of course "type" is a string but it would not be a problem to build it depending on a result. My point in the question was if it was possible to have a variable picture, for example to illustrate different geometrical configurations.&amp;nbsp; Of course the "price to pay" is to have the collection of GIF-files stored in the active directory (or somewhere else).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot everyone&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Claudio&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 06:21:41 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790882#M200741</guid>
      <dc:creator>ClaudioPedrazzi</dc:creator>
      <dc:date>2022-04-20T06:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Showing a different jpg image depending on a result (MathCAD 15.0)</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790928#M200743</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Of course the "price to pay" is to have the collection of GIF-files stored in the active directory (or somewhere else).&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not necessarily! You can read in the images once when creating the worksheet and then store the matrix permanently in the worksheet via Insert-Data-Table. Of course, this will make the file larger, but no external extra files are needed any more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EDIT: Find attached an example&lt;/P&gt;
&lt;P&gt;Of course normally you would hide the arguments of the list box and the picture region and the definition of the matrices could be hidden in a collapsed area.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Werner_E_0-1650449435844.png" style="width: 400px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/56057i744A8662D81C1871/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Werner_E_0-1650449435844.png" alt="Werner_E_0-1650449435844.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 10:10:59 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790928#M200743</guid>
      <dc:creator>Werner_E</dc:creator>
      <dc:date>2022-04-20T10:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Showing a different jpg image depending on a result (MathCAD 15.0)</title>
      <link>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790950#M200745</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/213621"&gt;@ClaudioPedrazzi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Stuart and Terry,&lt;/P&gt;
&lt;P&gt;thanks for the hints.&amp;nbsp; For some reason I didn't manage to obtain stable results with jpg. Some images (color and b/w) were readable, other not! Of course all of them were made with the same tool, namely the "Snipping Tool" of Windows, and about the same pixel dimensions.&lt;/P&gt;
&lt;P&gt;The GIF format seemed to work better.&amp;nbsp; So my actual solution looks like this, in the most simple form:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Unbenannt.PNG" style="width: 378px;"&gt;&lt;img src="https://www.ptcusercommunity.com/t5/image/serverpage/image-id/56045i69CB18C24E89B30F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Unbenannt.PNG" alt="Unbenannt.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;of course "type" is a string but it would not be a problem to build it depending on a result. My point in the question was if it was possible to have a variable picture, for example to illustrate different geometrical configurations.&amp;nbsp; Of course the "price to pay" is to have the collection of GIF-files stored in the active directory (or somewhere else).&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Given those images have to be somewhere, another option for &lt;FONT face="comic sans ms,sans-serif"&gt;type&lt;/FONT&gt; selection might be to pick the image from a grid.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could even make a game of it ...&amp;nbsp;&lt;A href="https://community.ptc.com/t5/PTC-Mathcad/Toads-and-Frogs/m-p/193572#M75890" target="_blank"&gt;https://community.ptc.com/t5/PTC-Mathcad/Toads-and-Frogs/m-p/193572#M75890&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stuart&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 11:57:04 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Mathcad/Showing-a-different-jpg-image-depending-on-a-result-MathCAD-15-0/m-p/790950#M200745</guid>
      <dc:creator>StuartBruff</dc:creator>
      <dc:date>2022-04-20T11:57:04Z</dc:date>
    </item>
  </channel>
</rss>

