Convert a path of a image on the db to a image on the BO?


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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).  We try not to serialize anything in regards to images as it really bloats the file and makes it larger.  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.  But when pulling form disk, just give the bitmap the path:

New Bitmap("c:\myimage.jpg")

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).

Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
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,





when I don´t like to load everytime a property if it was filled previously I do:



private _mycustomImage as image

property mycustomimage

get

if _mycustomimage is nothing then

'-- read image from db and convert it to a image...

_mycustomImage = imagethatIgetfrompath

endif

return _mycustomimage

end get

end property



but this is not possible for a custom property on BO



I not sure about Custom Code on BOM or what solution is the best recommendation.



Thanks
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search