Requirement :
It should be possible to change the size of a slide element. change the width and height of image
Behavior:
When we select the slide , the width and height of the image is shown in the input box .
When we change the width and height from input box , image size is not getting changed as expected .
Kindly let me know how to acheieve this task .
HTML :
<img class="imgClass ng-scope" data-ng-style="slideCTRL.changeImagesize(addOn)" ng-src="pictures/vivek/Hydrangeas.jpg" ng-if="addOn.type == 'picture'">
Javascript :
vm.changeImagesize = function (addOn) {
var width = $(".imgContainer").width();
var height = $(".imgContainer").height();
//var height = width * (resolutionY / resolutionX);
var imagewidth=$(".dcsTextbox input.slave").val();
var imageheight=$(".dcsTextbox:eq(1) input.slave").val();
var transform = "";
var origin = "50% 50%";
if (addOn.rotationDeg === 90) {
width = $(".imgContainer").width() * (resolutionY / resolutionX);
height = $(".imgContainer").width();
origin = "0% 0%";
transform = "translateX(" + $(".imgContainer").width() + "px)";
}
if (addOn.rotationDeg === 270) {
width = $(".imgContainer").width() * (resolutionY / resolutionX);
height = $(".imgContainer").width();
origin = "0% 0%";
transform = "translateY(" + width + "px)";
}
var borderStyle = "hidden";
var addOnIndex = $scope.viewModel.selectedAddon;
if (addOnIndex !== undefined && $scope.viewModel.actSlideShow.children[$scope.viewModel.currentSlide].children[addOnIndex] === addOn) {
borderStyle = "dashed";
}
if (addOn.type === "picture") {
return {
"width":imagewidth,
"height":imageheight,
"max-width": width,
"max-height":height,
"transform": transform + " " + addOn.transform,
"transform-origin": origin,
"border-style": borderStyle,
"border-width": "thin",
"object-fit": "cover"
};
} else if (addOn.type === "text") {
return {
position: "absolute",
left: 0,
top: 0,
width: width,
height: height / resolutionY * addOn.height,
"font-size": height / resolutionY * addOn.height,
color: addOn.color,
"text-align": "center",
"border-style": borderStyle,
"border-width": "thin",
transform: transform + " " + addOn.transform,
"transform-origin": origin,
"z-index": addOn.level
};
}
};
getAddOnStyle? I only seechangeImagesize