You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

94 lines
2.6 KiB
HTML

@{
//Layout = null;
ViewBag.Title = "Kep图形平台";
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Kep图形平台</title>
@Scripts.Render("~/bundles/jquery")
<style>
body {
display: flex;
font-family: Arial, sans-serif;
}
.sidebar {
display: flex;
flex-direction: column;
float: left;
width: 60px;
padding: 1px;
border-right: 1px solid #ccc;
}
.sidebar button {
margin: 1px 0;
padding: 1px;
font-size: 16px;
cursor: pointer;
}
.content {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
padding: 5px;
}
.content img {
max-width: 100%;
height: auto;
}
</style>
</head>
<body>
<div id="img_Drawer">
<div class="sidebar">
<button id="btnZoomIn">放大</button>
<button id="btnZoomOut">缩小</button>
<button>Button 3</button>
<button>Button 4</button>
<button>Button 5</button>
</div>
<div class="content" style="display:inline-flex">
<img id="img" alt="Kep 可视化图形控件">
</div>
<!--<h2>@ViewBag.Title</h2>
<button id="btn">放大</button> <button id="btn2">缩小</button>-->
@*<img id="img" src="/Home/Image?ttt=1" />*@
<!--<img id="img" />-->
</div>
<script type="text/javascript">
$(function () {
$(document).ready(function () {
draw("/Home/Open", { ttt: 2 });
});
$("#btnZoomIn").click(() => {
draw("/Home/ZoomIn", { ttt: 2 });
});
$("#btnZoomOut").click(() => {
draw("/Home/ZoomOut", { ttt: 2 });
});
function draw(url, data) {
console.log(url);
$.ajax({
url: url,
data: data,
type: 'POST',
success: function (res) {
console.log(res);
$("#img").attr('src', 'data:image/png;base64,' + res);
},
error: function (res) {
console.log(res);
}
});
}
});
</script>
</body>
</html>