This is an artefact of Northwind's Access heritage. The 78 superfluous bytes are a proprietary OLE header that Access creates when saving bitmaps.
<!-- HTML5 -->
<img src="http://services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture/$value">
<!-- SAPUI5 XMLView -->
<Image src="http://services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture/$value" />
<!-- HTML5 -->
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" >
<!-- SAPUI5 XMLView -->
<Image src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" />
<html>
<head>
<meta charset="utf-8">
<title>SAPUI5 single file template | nabisoft</title>
<script src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-theme="sap_bluecrystal"
data-sap-ui-libs="sap.m"
data-sap-ui-bindingSyntax="complex"
data-sap-ui-compatVersion="edge"
data-sap-ui-preload="async"></script>
<!-- use "sync" or change the code below if you have issues -->
<!-- XMLView -->
<script id="myXmlView" type="ui5/xmlview">
<mvc:View
controllerName="MyController"
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc">
<!-- sap.m.Image supports Data URIs -->
<Image src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==" />
<Image id="myImage"/>
</mvc:View>
</script>
<script>
sap.ui.getCore().attachInit(function () {
"use strict";
//### Controller ###
sap.ui.define([
"sap/ui/core/mvc/Controller",
], function (Controller) {
"use strict";
return Controller.extend("MyController", {
onInit : function () {
var sUrl, oImg;
sUrl = "https://cors-anywhere.herokuapp.com/services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture?$format=json";
oImg = this.byId("myImage");
$.get( sUrl, function( data ) {
var sTrimmedData = data.d.Picture.substr(104);
oImg.setSrc("data:image/bmp;base64," + sTrimmedData);
});
}
});
});
//### THE APP: place the XMLView somewhere into DOM ###
sap.ui.xmlview({
viewContent : jQuery("#myXmlView").html()
}).placeAt("content");
});
</script>
</head>
<body class="sapUiBody">
<div id="content"></div>
</body>
</html>
<!-- HTML5 -->
<!-- Picture is an Edm.Binary property of Employee Entity-->
<img src="/path/to/my/service.svc/Employees(1234)/Picture/$value" >
<!-- Employee Entity has a Media Link and returns the Employee's image as binaries-->
<img src="/path/to/my/service.svc/Employees(1234)/$value" >
<!-- SAPUI5 XMLView -->
<!-- Picture is an Edm.Binary property of Employee Entity-->
<Image src="/path/to/my/service.svc/Employees(1234)/Picture/$value" />
<!-- Employee Entity has a Media Link and returns the Employee's image as binaries-->
<Image src="/path/to/my/service.svc/Employees(1234)/$value" />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |