diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
index c695cff..f9f2743 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -3232,37 +3232,43 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
img.src = dataURL;
- var DAData = new BitmapData(img.width, img.height);
- DAData.draw(img);
- var RED = 0.3086; // luminance contrast value for red
- var GREEN = 0.694; // luminance contrast value for green
- var BLUE = 0.0820; // luminance contrast value for blue
- var RGB = [RED, GREEN, BLUE, 0, 0];
- var RGB2 = [RED, GREEN, BLUE, 0, 0];
- var RGB3 = [RED, GREEN, BLUE, 0, 0];
- var ALPHA = [0, 0, 0, 1, 0];
- var rgbPx = RGB.concat(RGB2);
- var rgbPx2 = rgbPx.concat(RGB3);
- var matrix = rgbPx2.concat(ALPHA);
+ img.onload = function () {
+ console.log(Math.max(img.width) + ', ' + Math.max(img.height))
- var zeroPoint = new Point();
- var grayScale = new ColorMatrixFilter(matrix);
- DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
+ var DAData = new BitmapData(Math.max(img.width), Math.max(img.height));
+ DAData.draw(img);
+ var RED = 0.3086; // luminance contrast value for red
+ var GREEN = 0.694; // luminance contrast value for green
+ var BLUE = 0.0820; // luminance contrast value for blue
- context_gray.putImageData(DAData.data, 0, 0)
+ var RGB = [RED, GREEN, BLUE, 0, 0];
+ var RGB2 = [RED, GREEN, BLUE, 0, 0];
+ var RGB3 = [RED, GREEN, BLUE, 0, 0];
+ var ALPHA = [0, 0, 0, 1, 0];
- var grayImageData = context_gray.getImageData(0, 0, width, ht);
- var grayImageImageDataVar = grayImageData.data;
+ var rgbPx = RGB.concat(RGB2);
+ var rgbPx2 = rgbPx.concat(RGB3);
+ var matrix = rgbPx2.concat(ALPHA);
- if (value.haveMirror == 'true') {
- $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
- }
- else {
- //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
+ var zeroPoint = new Point();
+ var grayScale = new ColorMatrixFilter(matrix);
+ DAData.applyFilter(DAData, DAData.rect, zeroPoint, grayScale);
+
+ context_gray.putImageData(DAData.data, 0, 0)
- $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
+ var grayImageData = context_gray.getImageData(0, 0, width, ht);
+ var grayImageImageDataVar = grayImageData.data;
+
+ if (value.haveMirror == 'true') {
+ $rootScope.grayImageMRDataList[parseInt(value.bodyRegionId)] = grayImageData;
+ }
+ else {
+ //$rootScope.coloredImageMRCanvasList[parseInt(value.bodyRegionId - 1)] = 1;
+
+ $rootScope.grayImageDataList[parseInt(value.bodyRegionId - 1)] = grayImageData;
+ }
}