﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » .NET Forums » General .NET Discussion  » Convert a path of a image on the db to a image on the BO?</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 00:16:59 GMT</lastBuildDate><ttl>20</ttl><item><title>Convert a path of a image on the db to a image on the BO?</title><link>http://forum.strataframe.net/FindPost16554.aspx</link><description>What is the best way to show a image that I have to convert from a path on the db to a image on my UI? I think about a custom readonly property that read it, serialize it and show it, &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
when I don´t like to load everytime a property if it was filled previously I do:&lt;br&gt;
&lt;br&gt;
private _mycustomImage as image&lt;br&gt;
property mycustomimage&lt;br&gt;
    get&lt;br&gt;
          if _mycustomimage is nothing then&lt;br&gt;
                '-- read image from db and convert it to a image...&lt;br&gt;
               _mycustomImage = imagethatIgetfrompath&lt;br&gt;
          endif&lt;br&gt;
          return _mycustomimage&lt;br&gt;
     end get&lt;br&gt;
end property&lt;br&gt;
&lt;br&gt;
but this is not possible for a custom property on BO&lt;br&gt;
&lt;br&gt;
I not sure about Custom Code on BOM or what solution is the best recommendation.&lt;br&gt;
&lt;br&gt;
Thanks</description><pubDate>Mon, 26 May 2008 14:03:38 GMT</pubDate><dc:creator>Fabian R Silva, -</dc:creator></item><item><title>RE: Convert a path of a image on the db to a image on the BO?</title><link>http://forum.strataframe.net/FindPost16594.aspx</link><description>We actually have a portion of our medical application that is a document and imaging product that allows images to be stored in either a database or on disk (if they use SQL Express then this would be the road they take).&amp;nbsp; We try not to serialize anything in regards to images as it really bloats the file and makes it larger.&amp;nbsp; So when we use the database side, we store the image as a JPG, PNG, etc. as a byte array in a VarBInary(MAX) field.&amp;nbsp; But when pulling form disk, just give the bitmap the path:&lt;/P&gt;&lt;P&gt;[codesnippet]New Bitmap("c:\myimage.jpg")[/codesnippet]&lt;/P&gt;&lt;P&gt;We have a shared class that gives us all of the logical installed paths (this path can be set by the end-user) so we add that logic in as well which can be placed in the BO (custom code property).</description><pubDate>Mon, 26 May 2008 14:03:38 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>