Commit e9a0325ebddfc7ca1be6775786bb02691c561904
1 parent
c81a82e5
issue is resolved
Showing
1 changed file
with
77 additions
and
17 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -5296,28 +5296,47 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
5296 | 5296 | var imageData = imageD.data; |
5297 | 5297 | var length = imageData.length; |
5298 | 5298 | |
5299 | - // set every fourth value to the desired number of transparency | |
5300 | 5299 | |
5300 | + //to resolve lateral arm black issue in highlight mode | |
5301 | + if ($scope.isHighLight) { | |
5302 | + // if ($scope.voId == "9" || $scope.voId == "11") { | |
5303 | + | |
5304 | + var c = 0; | |
5305 | + for (var i = 0; i < imageData.length; i += 4) { | |
5306 | + if (imageData[i] == imageData[i + 1] && imageData[i + 1] == imageData[i + 2] && imageData[i + 2] === 0) { | |
5307 | + imageData[i + 3] = 0; | |
5308 | + } | |
5309 | + | |
5310 | + } | |
5311 | + tempCtx.putImageData(imageD, 0, 0); | |
5312 | + //} | |
5313 | + } | |
5314 | + // set every fourth value to the desired number of transparency | |
5315 | + var imageD1 = tempCtx.getImageData(0, 0, Width, Height); | |
5316 | + var imageData1 = imageD1.data; | |
5317 | + var length = imageData.length; | |
5301 | 5318 | |
5302 | 5319 | for (var i = 3; i < length; i += 4) { |
5303 | 5320 | if ($scope.voId == "9" || $scope.voId == "11") { |
5304 | 5321 | |
5305 | - if (imageData[i] == 0) { | |
5322 | + if (imageData1[i] == 0) { | |
5306 | 5323 | |
5307 | 5324 | } |
5308 | 5325 | else { |
5309 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
5326 | + imageData1[i] = ((255) * (parseInt(transNumber))) / 100; | |
5310 | 5327 | } |
5311 | 5328 | } |
5312 | 5329 | else { |
5313 | 5330 | |
5314 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
5331 | + imageData1[i] = ((255) * (parseInt(transNumber))) / 100; | |
5315 | 5332 | } |
5316 | 5333 | |
5317 | 5334 | |
5318 | 5335 | } |
5319 | 5336 | |
5320 | - tempCtx.putImageData(imageD, 0, 0); | |
5337 | + | |
5338 | + | |
5339 | + tempCtx.putImageData(imageD1, 0, 0); | |
5321 | 5340 | |
5322 | 5341 | |
5323 | 5342 | $scope.widthOfImage = WidthforTransImage; |
... | ... | @@ -5401,31 +5420,52 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
5401 | 5420 | var modestyTemCanvas = $("canvas[id*='tempCanvasModesty_']"); |
5402 | 5421 | if (modestyTransCanvases != null || modestyTransCanvases != undefined && modestyTransCanvases.length > 0) { |
5403 | 5422 | |
5423 | + //for modesty | |
5404 | 5424 | for (var j = 0; j < modestyTransCanvases.length; j++) { |
5405 | - var ctx = document.getElementById(modestyTransCanvases[j].id).getContext('2d'); | |
5406 | - var imageDa = ctx.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height); | |
5425 | + var modctx = document.getElementById(modestyTransCanvases[j].id).getContext('2d'); | |
5426 | + var modimageDa = modctx.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height); | |
5427 | + //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); | |
5428 | + | |
5429 | + var modimageData = modimageDa.data; | |
5430 | + var length = modimageData.length; | |
5431 | + | |
5432 | + if ($scope.isHighLight) { | |
5433 | + //if ($scope.voId == "9" || $scope.voId == "11") { | |
5434 | + | |
5435 | + var c = 0; | |
5436 | + for (var i = 0; i < modimageData.length; i += 4) { | |
5437 | + if (modimageData[i] == modimageData[i + 1] && modimageData[i + 1] == modimageData[i + 2] && modimageData[i + 2] === 0) { | |
5438 | + modimageData[i + 3] = 0; | |
5439 | + } | |
5440 | + | |
5441 | + } | |
5442 | + modctx.putImageData(modimageDa, 0, 0); | |
5443 | + // } | |
5444 | + } | |
5445 | + // set every fourth value to desired transparency | |
5446 | + var ctx1 = document.getElementById(modestyTransCanvases[j].id).getContext('2d'); | |
5447 | + var imageDa1 = ctx1.getImageData(0, 0, modestyTransCanvases[j].width, modestyTransCanvases[j].height); | |
5407 | 5448 | //modestyTransCanvases[j].parentNode.removeChild(modestyTransCanvases[j]); |
5408 | 5449 | |
5409 | - var imageData = imageDa.data; | |
5410 | - var length = imageData.length; | |
5411 | - // set every fourth value to 50 | |
5450 | + var imageData1 = imageDa1.data; | |
5451 | + var length = imageData1.length; | |
5412 | 5452 | for (var i = 3; i < length; i += 4) { |
5413 | - //NIKITA | |
5453 | + | |
5414 | 5454 | if ($scope.voId == "9" || $scope.voId == "11") { |
5415 | 5455 | |
5416 | - if (imageData[i] == 0) { | |
5456 | + if (imageData1[i] == 0) { | |
5417 | 5457 | |
5418 | 5458 | } |
5419 | 5459 | else { |
5420 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
5460 | + imageData1[i] = ((255) * (parseInt(transNumber))) / 100; | |
5421 | 5461 | } |
5422 | 5462 | } |
5423 | 5463 | else { |
5424 | - if (imageData[i] == 0) { | |
5464 | + if (imageData1[i] == 0) { | |
5425 | 5465 | |
5426 | 5466 | } |
5427 | 5467 | else |
5428 | - imageData[i] = ((255) * (parseInt(transNumber))) / 100; | |
5468 | + imageData1[i] = ((255) * (parseInt(transNumber))) / 100; | |
5429 | 5469 | } |
5430 | 5470 | |
5431 | 5471 | // imageData[i] = ((255) * (parseInt(transNumber))) / 100; |
... | ... | @@ -5434,7 +5474,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
5434 | 5474 | // imageDa.data = imageData; |
5435 | 5475 | // and put the imagedata back to the canvas |
5436 | 5476 | //ctx.putImageData(imageDa, XforTransImage, YforTransImage); |
5437 | - ctx.putImageData(imageDa, 0, 0); | |
5477 | + ctx1.putImageData(imageDa1, 0, 0); | |
5438 | 5478 | } |
5439 | 5479 | } |
5440 | 5480 | |
... | ... | @@ -5442,12 +5482,32 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
5442 | 5482 | var ctx = document.getElementById('transparencyCanvas').getContext('2d'); |
5443 | 5483 | |
5444 | 5484 | // var imageDa = ctx.getImageData(XforTransImage, YforTransImage, WidthforTransImage, HeightforTransImage); |
5485 | + var imageDa1 = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight); | |
5486 | + | |
5487 | + // get the image data values | |
5488 | + var imageData1 = imageDa1.data; | |
5489 | + var length = imageData1.length; | |
5490 | + | |
5491 | + if ($scope.isHighLight) { | |
5492 | + if ($scope.voId == "9" || $scope.voId == "11") { | |
5493 | + | |
5494 | + var c = 0; | |
5495 | + for (var i = 0; i < imageData1.length; i += 4) { | |
5496 | + if (imageData1[i] == imageData1[i + 1] && imageData1[i + 1] == imageData1[i + 2] && imageData1[i + 2] === 0) { | |
5497 | + imageData1[i + 3] = 0; | |
5498 | + } | |
5499 | + | |
5500 | + } | |
5501 | + ctx.putImageData(imageDa1, 0, 0); | |
5502 | + } | |
5503 | + } | |
5504 | + | |
5505 | + // set every fourth value to selected transparency | |
5445 | 5506 | var imageDa = ctx.getImageData(0, 0, $scope.transparencyCanvasWidth, $scope.transparencyCanvasHeight); |
5446 | 5507 | |
5447 | 5508 | // get the image data values |
5448 | 5509 | var imageData = imageDa.data; |
5449 | 5510 | var length = imageData.length; |
5450 | - // set every fourth value to 50 | |
5451 | 5511 | for (var i = 3; i < length; i += 4) { |
5452 | 5512 | //NIKITA |
5453 | 5513 | if ($scope.voId == "9" || $scope.voId == "11") { | ... | ... |