diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 379e44c..42f93d6 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -5412,28 +5412,47 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var imageData = imageD.data; var length = imageData.length; - // set every fourth value to the desired number of transparency + //to resolve lateral arm black issue in highlight mode + if ($scope.isHighLight) { + // if ($scope.voId == "9" || $scope.voId == "11") { + + var c = 0; + for (var i = 0; i < imageData.length; i += 4) { + if (imageData[i] == imageData[i + 1] && imageData[i + 1] == imageData[i + 2] && imageData[i + 2] === 0) { + imageData[i + 3] = 0; + } + + } + tempCtx.putImageData(imageD, 0, 0); + //} + } + // set every fourth value to the desired number of transparency + var imageD1 = tempCtx.getImageData(0, 0, Width, Height); + var imageData1 = imageD1.data; + var length = imageData.length; for (var i = 3; i < length; i += 4) { if ($scope.voId == "9" || $scope.voId == "11") { - if (imageData[i] == 0) { + if (imageData1[i] == 0) { } else { - imageData[i] = ((255) * (parseInt(transNumber))) / 100; + imageData1[i] = ((255) * (parseInt(transNumber))) / 100; } } else { - imageData[i] = ((255) * (parseInt(transNumber))) / 100; + imageData1[i] = ((255) * (parseInt(transNumber))) / 100; } } - tempCtx.putImageData(imageD, 0, 0); + + + tempCtx.putImageData(imageD1, 0, 0); $scope.widthOfImage = WidthforTransImage; @@ -5517,31 +5536,52 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var modestyTemCanvas = $("canvas[id*='tempCanvasModesty_']"); if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { + //for modesty for (var j = 0; j < modestyTransCanvases.length; j++) { - var ctx = document.getElementById(modestyTransCanvases[j].id).getContext('2d'); - var imageDa = ctx.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height); + var modctx = document.getElementById(modestyTransCanvases[j].id).getContext('2d'); + var modimageDa = modctx.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height); + //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); + + var modimageData = modimageDa.data; + var length = modimageData.length; + + if ($scope.isHighLight) { + //if ($scope.voId == "9" || $scope.voId == "11") { + + var c = 0; + for (var i = 0; i < modimageData.length; i += 4) { + if (modimageData[i] == modimageData[i + 1] && modimageData[i + 1] == modimageData[i + 2] && modimageData[i + 2] === 0) { + modimageData[i + 3] = 0; + } + + } + modctx.putImageData(modimageDa, 0, 0); + // } + } + // set every fourth value to desired transparency + var ctx1 = document.getElementById(modestyTransCanvases[j].id).getContext('2d'); + var imageDa1 = ctx1.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height); //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); - var imageData = imageDa.data; - var length = imageData.length; - // set every fourth value to 50 + var imageData1 = imageDa1.data; + var length = imageData1.length; for (var i = 3; i < length; i += 4) { - //NIKITA + if ($scope.voId == "9" || $scope.voId == "11") { - if (imageData[i] == 0) { + if (imageData1[i] == 0) { } else { - imageData[i] = ((255) * (parseInt(transNumber))) / 100; + imageData1[i] = ((255) * (parseInt(transNumber))) / 100; } } else { - if (imageData[i] == 0) { + if (imageData1[i] == 0) { } else - imageData[i] = ((255) * (parseInt(transNumber))) / 100; + imageData1[i] = ((255) * (parseInt(transNumber))) / 100; } // imageData[i] = ((255) * (parseInt(transNumber))) / 100; @@ -5550,7 +5590,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // imageDa.data = imageData; // and put the imagedata back to the canvas //ctx.putImageData(imageDa, XforTransImage, YforTransImage); - ctx.putImageData(imageDa, 0, 0); + ctx1.putImageData(imageDa1, 0, 0); } } @@ -5558,12 +5598,32 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var ctx = document.getElementById('transparencyCanvas').getContext('2d'); // var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); + var imageDa1 = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight); + + // get the image data values + var imageData1 = imageDa1.data; + var length = imageData1.length; + + if ($scope.isHighLight) { + if ($scope.voId == "9" || $scope.voId == "11") { + + var c = 0; + for (var i = 0; i < imageData1.length; i += 4) { + if (imageData1[i] == imageData1[i + 1] && imageData1[i + 1] == imageData1[i + 2] && imageData1[i + 2] === 0) { + imageData1[i + 3] = 0; + } + + } + ctx.putImageData(imageDa1, 0, 0); + } + } + + // set every fourth value to selected transparency var imageDa = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight); // get the image data values var imageData = imageDa.data; var length = imageData.length; - // set every fourth value to 50 for (var i = 3; i < length; i += 4) { //NIKITA if ($scope.voId == "9" || $scope.voId == "11") {