Commit aa8c798643b7b42272f16b56b1145fa7565f778e
1 parent
d56ccfaa
This issue is fixed.
Showing
1 changed file
with
62 additions
and
22 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -5865,12 +5865,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
5865 | 5865 | var isMirror = BRSixData[0].IsMirror; |
5866 | 5866 | if (isMirror == 'Yes') { |
5867 | 5867 | //draw mirror arm |
5868 | - $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'Yes', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid); | |
5868 | + $scope.loadTransparencyImage(BRSixData[0].bodyRegionId, BRSixData[0].Height, BRSixData[0].Width, BRSixData[0].X, BRSixData[0].Y, 'Yes', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, false, windowviewid); | |
5869 | 5869 | //draw non mirror arm |
5870 | - $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'No', $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid); | |
5870 | + $scope.loadTransparencyImage(BRSixData[1].bodyRegionId, BRSixData[1].Height, BRSixData[1].Width, BRSixData[1].X, BRSixData[1].Y, 'No', $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, false, windowviewid); | |
5871 | 5871 | //draw 3rd BR |
5872 | 5872 | $timeout(function () { |
5873 | - $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, TransparencyEndX, $scope.TransparencyBoxStartY, TransparencyBoxEndY, $scope, false, false, false, windowviewid); | |
5873 | + $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, $scope.TransparencyBoxStartX, $scope.TransparencyEndX, $scope.TransparencyBoxStartY, $scope.TransparencyBoxEndY, $scope, false, false, false, windowviewid); | |
5874 | 5874 | }, 200); |
5875 | 5875 | } |
5876 | 5876 | else { |
... | ... | @@ -6751,8 +6751,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
6751 | 6751 | $scope.changeTransparency = function (windowviewid) { |
6752 | 6752 | //this changes the transparency when user click on transparency scale(we have already set the original |
6753 | 6753 | //data on tras canvas irrespective of the trans number, so we can chnage the transparnecy of original data not the manipulated) |
6754 | - | |
6755 | - var transNumber = $scope.GetwindowStoreData(windowviewid,'transNumber'); | |
6754 | + console.log("INSIDE CHANGETRANS>>>>>>>>") | |
6755 | + var transNumber = $scope.GetwindowStoreData(windowviewid, 'transNumber'); | |
6756 | + console.log("transNumber= " + transNumber); | |
6756 | 6757 | var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId'); |
6757 | 6758 | var isHighLight=$scope.GetwindowStoreData(windowviewid,'isHighLight'); |
6758 | 6759 | var modestyTransCanvases = $("canvas[id*='modestyTransCanavs']"); |
... | ... | @@ -6828,18 +6829,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
6828 | 6829 | var imageData1 = imageDa1.data; |
6829 | 6830 | var length = imageData1.length; |
6830 | 6831 | |
6831 | - if (isHighLight) { | |
6832 | - if (bodyVid == "9" || bodyVid == "11") { | |
6833 | - | |
6834 | - var c = 0; | |
6835 | - for (var i = 0; i < imageData1.length; i += 4) { | |
6836 | - if (imageData1[i] == imageData1[i + 1] && imageData1[i + 1] == imageData1[i + 2] && imageData1[i + 2] === 0) { | |
6837 | - imageData1[i + 3] = 0; | |
6838 | - } | |
6839 | - } | |
6840 | - ctx.putImageData(imageDa1, 0, 0); | |
6841 | - } | |
6842 | - } | |
6843 | 6832 | |
6844 | 6833 | // set every fourth value to selected transparency |
6845 | 6834 | var imageDa = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight); |
... | ... | @@ -7675,7 +7664,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
7675 | 7664 | var originalTransparencyData = tempCanvasContext.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight); |
7676 | 7665 | |
7677 | 7666 | if ($scope.GetwindowStoreData(windowviewid, 'isHighLight') == true) { |
7678 | - $timeout(function () { | |
7667 | + //$timeout(function () { | |
7679 | 7668 | |
7680 | 7669 | //var tempTransCanvas = document.getElementById(tempCanvasID); |
7681 | 7670 | //var tempCanvasContext = tempTransCanvas.getContext('2d'); |
... | ... | @@ -7686,11 +7675,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
7686 | 7675 | img.src = dataURL; |
7687 | 7676 | |
7688 | 7677 | img.onload = function () { |
7689 | - console.log("TBIMG LOADDDDDDDDLLLLLL") | |
7678 | + | |
7690 | 7679 | var DAData = new BitmapData(parseInt(tempCanavs.width), parseInt(tempCanavs.height)); |
7691 | 7680 | DAData.draw(img); |
7692 | 7681 | |
7693 | - var colorMode = $scope.applyGrayMatrix(img, ctx); | |
7682 | + var colorMode = $scope.applyGrayMatrix(img, tempCanvasContext); | |
7694 | 7683 | |
7695 | 7684 | if (colorMode != undefined || colorMode != null) { |
7696 | 7685 | |
... | ... | @@ -7717,9 +7706,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
7717 | 7706 | } |
7718 | 7707 | |
7719 | 7708 | |
7720 | - }, 50); | |
7709 | + //}, 50); | |
7721 | 7710 | } |
7722 | 7711 | else { |
7712 | + | |
7723 | 7713 | ctx.putImageData(originalTransparencyData, 0, 0); |
7724 | 7714 | } |
7725 | 7715 | |
... | ... | @@ -7736,10 +7726,60 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
7736 | 7726 | var modestyTransCanvasId = 'modestyTransCanavs_' + brId + "_" + windowviewid; |
7737 | 7727 | if (document.getElementById(modestyTransTempCanvasId) != null) { |
7738 | 7728 | |
7729 | + | |
7739 | 7730 | var tempCanvasContext = document.getElementById(modestyTransTempCanvasId).getContext('2d'); |
7740 | 7731 | var originalTransparencyData = tempCanvasContext.getImageData(0, 0, value.Width, value.Height); |
7741 | 7732 | var ctx = document.getElementById(modestyTransCanvasId).getContext('2d'); |
7742 | - ctx.putImageData(originalTransparencyData, 0, 0); | |
7733 | + | |
7734 | + if ($scope.GetwindowStoreData(windowviewid, 'isHighLight') == true) { | |
7735 | + //$timeout(function () { | |
7736 | + | |
7737 | + //var tempTransCanvas = document.getElementById(tempCanvasID); | |
7738 | + //var tempCanvasContext = tempTransCanvas.getContext('2d'); | |
7739 | + | |
7740 | + var dataURL = document.getElementById(modestyTransTempCanvasId).toDataURL(); | |
7741 | + | |
7742 | + var img = new Image(); | |
7743 | + img.src = dataURL; | |
7744 | + | |
7745 | + img.onload = function () { | |
7746 | + | |
7747 | + var DAData = new BitmapData(parseInt(document.getElementById(modestyTransTempCanvasId).width), parseInt(document.getElementById(modestyTransTempCanvasId).height)); | |
7748 | + DAData.draw(img); | |
7749 | + | |
7750 | + var colorMode = $scope.applyGrayMatrix(img, tempCanvasContext); | |
7751 | + | |
7752 | + if (colorMode != undefined || colorMode != null) { | |
7753 | + | |
7754 | + var zeroPoint = new Point(); | |
7755 | + | |
7756 | + DAData.applyFilter(DAData, DAData.rect, zeroPoint, colorMode); | |
7757 | + | |
7758 | + ctx.putImageData(DAData.data, 0, 0); | |
7759 | + | |
7760 | + | |
7761 | + | |
7762 | + //black issue | |
7763 | + var imgData = ctx.getImageData(0, 0, ocument.getElementById(modestyTransTempCanvasId).ocument.getElementById(modestyTransTempCanvasId), transCanvas.height); | |
7764 | + var data = imgData.data; | |
7765 | + var c = 0; | |
7766 | + for (var i = 0; i < data.length; i += 4) { | |
7767 | + if (data[i] == data[i + 1] && data[i + 1] == data[i + 2] && data[i + 2] === 0) { | |
7768 | + data[i + 3] = 0; | |
7769 | + } | |
7770 | + | |
7771 | + } | |
7772 | + ctx.putImageData(imgData, 0, 0); | |
7773 | + } | |
7774 | + } | |
7775 | + | |
7776 | + | |
7777 | + //}, 50); | |
7778 | + } | |
7779 | + else { | |
7780 | + | |
7781 | + ctx.putImageData(originalTransparencyData, 0, 0); | |
7782 | + } | |
7743 | 7783 | } |
7744 | 7784 | }) |
7745 | 7785 | } | ... | ... |