How to show Bitmap in Razor cshtml

Viewed 38

I'm receiving an list of objects from a model with 6 properties that I need to show in a table in cshtml, one property of these objects are System.Drawing.Bitmap type which is generated at runtime.

is there a way to show this Bitmap object with Razor in the cshtml? Thanks everyone!

 @model List<Database.DisplayPiece>

@{
    Layout = "~/Views/Shared/_VisualRuleLayout.cshtml";
}

<!DOCTYPE html>
<html>
<head>

</head>
<body>
    <h3>@ViewBag.title</h3>
    <table class="table">
        <thead>
            <tr>
                <th>Branch #</th>
                <th>Lot</th>
                <th>Last Ordered</th>
                <th>Width (inches)</th>
                <th>Length (feet)</th>
                <th>Available</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var available in Model)
            {
                <tr>
                    <td>@Html.DisplayFor(m => available.Branch)</td>
                    <td>@Html.DisplayFor(m => available.LotName)</td>
                    <td>@Html.DisplayFor(m => available.OrderDate)</td>
                    <td>@Html.DisplayFor(m => available.Width)</td>
                    <td>@Html.DisplayFor(m => available.Length)</td>
                    <td>@Html.DisplayFor(m => available.Bitmap)</td>
                </tr>
            }

        </tbody>
    </table>
</body>
</html>
0 Answers
Related