Author: Not specified Language: text
Description: (v2) Timestamp: 2018-06-14 13:01:52 +0000
View raw paste Parent paste by: Not specified Reply
  1. function onPhotoDataSuccess(imageData) {
  2.     gridObj.index++;
  3.     var i = gridObj.index.toString();
  4.  
  5.     gridObj["GridData" + i] = new sap.ui.layout.GridData("GridData" + i, {
  6.         visibleXL: true,
  7.         visibleS: true,
  8.         visibleM: true,
  9.         visibleL: true,
  10.         spanL: 4,
  11.         spanM: 4,
  12.         spanS: 4,
  13.         linebreakXL: false,
  14.         linebreakS: false,
  15.         linebreakM: false,
  16.         linebreakL: false,
  17.         linebreak: false
  18.     });
  19.  
  20.     gridObj["VBox" + i] = new sap.m.VBox("VBox" + i, {
  21.         alignContent: "Stretch",
  22.         backgroundDesign: "Transparent",
  23.         displayInline: false,
  24.         fitContainer: false,
  25.         visible: true,
  26.         wrap: "NoWrap"
  27.     });
  28.     gridObj["VBox" + i].setLayoutData(gridObj["GridData" + i]);
  29.     GridBilder.addContent(gridObj["VBox" + i]);
  30.  
  31.     gridObj["Image" + i] = new sap.m.Image("Image" + i, {
  32.         backgroundPosition: "initial",
  33.         backgroundRepeat: "initial",
  34.         backgroundSize: "cover",
  35.         decorative: true,
  36.         densityAware: true,
  37.         mode: "Image",
  38.         visible: true,
  39.         src: "data:image/jpeg;base64," + imageData,
  40.         width: "100%"/*,
  41.         press: function() {
  42.             ImageZoom.setSrc(this.getSrc());
  43.             DialogZoom.open();
  44.         }*/
  45.     });
  46.     gridObj["VBox" + i].addItem(gridObj["Image" + i]);
  47.  
  48.     gridObj["CheckBox" + i] = new sap.m.CheckBox("CheckBox" + i, {
  49.         activeHandling: true,
  50.         editable: true,
  51.         enabled: true,
  52.         selected: false,
  53.         visible: true
  54.     });
  55.     gridObj["VBox" + i].addItem(gridObj["CheckBox" + i]);
  56.  
  57.     //Falls das Bild in einer Horizontalen aufgenommen wurde wird die anzeige angepasst damit
  58.     //eine einheitliche Darstellung gewaehrleistet ist.
  59.     setTimeout(function() {
  60.  
  61.         var w = $('#Image' + i).width();
  62.         var h = $('#Image' + i).height();
  63.  
  64.         if (w > h) {
  65.             gridObj["VBox" + i].addStyleClass("landscapeImage");
  66.  
  67.         }
  68.     }, 100);
  69.  
  70. }
  71. //Fehlerfuktion der bilderaufnahme
  72. function onFail(error) {
  73.  
  74. }
  75.  
  76. //Aufnahme eines Bildes
  77. function capturePhoto() {
  78.     navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
  79.         quality: 20,
  80.         correctOrientation: true,
  81.         destinationType: destinationType.DATA_URL,
  82.         sourceType: pictureSource.CAMERA
  83.     });
  84.  
  85. }
  86.  
  87. function uploadPhoto() {
  88.     ////debugger;
  89.     navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
  90.         quality: 20,
  91.         correctOrientation: true,
  92.         destinationType: destinationType.DATA_URL,
  93.         sourceType: pictureSource.PHOTOLIBRARY
  94.     });
  95. }
  96.  
  97. function clearGalaryData() {
  98.     GridBilder.destroyContent();
  99.     gridObj = {};
  100.     gridObj.index = 0;
  101. }
  102.  
  103.  
View raw paste Parent paste by: Not specified Reply