Introduction

- Go to Solution Explorer
- Right-click on the Application name
- Select Add-->add new item
- Now in the window that opens, select an HTML page or new Webform
- Rename it by changecurve.aspx

- body {
- background: #FFFF99;
- color: #fff;
- font: 300 100.1% "Helvetica Neue" , Helvetica, "Arial Unicode MS" , Arial, sans-serif;
- }
- #holder {
- height: 442px;
- left: 42%;
- margin: -240px 0 0 -320px;
- position: absolute;
- top: 57%;
- width: 842px;
- font-size: x-large;
- background-color: #008000;
- }
- #duplicate {
- bottom: 0;
- font: 300 .7em "Helvetica Neue", Helvetica,;
- position: absolute;
- right: 1em;
- text-align: right;
- }
- #duplicate d {
- color: #fff;
- }
- body {
- background: #fff;
- color: #000;
- font: 100.1% "Comic Sans MS", Lucida, Verdana, sans-serif;
- }
- #holder {
- height: 480px;
- left: 50%;
- margin: 0 0 0 -320px;
- position: absolute;
- top: 0;
- width: 640px;
- }
- #duplicate {
- bottom: 0;
- font-size: .7em;
- position: absolute;
- right: 1em;
- text-align: right;
- }
- function move(dx, dy) {
- this.update(dx - (this.dx || 0), dy - (this.dy || 0));
- this.dx = dx;
- this.dy = dy;
- }
- window.onload = function() {
- var r = Color("holder", 620, 420),
- discattr = {
- fill: "#fff",
- stroke: "none"
- };
- r.rect(0, 0, 619, 419, 10).attr({
- stroke: "#666"
- });
- r.text(310, 20, "Change the curve postion").attr({
- fill: "#fff",
- "font-size": 16
- });
- function curve(x, y, ax, ay, bx, by, zx, zy, color) {
- var path = [
- ["M", x, y],
- ["C", ax, ay, bx, by, zx, zy]
- ],
- path2 = [
- ["M", x, y],
- ["L", ax, ay],
- ["M", bx, by],
- ["L", zx, zy]
- ],
- curve = r.path(path).attr({
- stroke: color || Color.getColor(),
- "stroke-width": 4,
- "stroke-linecap": "round"
- }),
- controls = r.set(
- r.path(path2).attr({
- stroke: "#ccc",
- "stroke-dasharray": ". "
- }),
- r.circle(x, y, 5).attr(discattr),
- r.circle(ax, ay, 5).attr(discattr),
- r.circle(bx, by, 5).attr(discattr),
- r.circle(zx, zy, 5).attr(discattr)
- );
- controls[1].update = function(x, y) {
- var X = this.attr("cx") + x,
- Y = this.attr("cy") + y;
- this.attr({
- cx: X,
- cy: Y
- });
- path[0][1] = X;
- path[0][2] = Y;
- path2[0][1] = X;
- path2[0][2] = Y;
- controls[2].update(x, y);
- function move(dx, dy) {
- this.update(dx - (this.dx || 0), dy - (this.dy || 0));
- this.dx = dx;
- this.dy = dy;
- }
- function up() {
- this.dx = this.dy = 0;
- }
- curve(70, 100, 110, 100, 130, 200, 170, 200, "hsb(0, .75, .75)");
- curve(170, 100, 210, 100, 230, 200, 270, 200, "hsb(.8, .75, .75)");
- curve(270, 100, 310, 100, 330, 200, 370, 200, "hsb(.3, .75, .75)");
- curve(370, 100, 410, 100, 430, 200, 470, 200, "hsb(.6, .75, .75)");
- curve(470, 100, 510, 100, 530, 200, 570, 200, "hsb(.1, .75, .75)");
- };
- <body>
- <div id="holder"></div>
- </body>
- <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="changecurve.aspx.cs" Inherits="changecurve._Default" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html
- xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title></title>
- <link rel="stylesheet" href="d1.css" type="text/css" media="screen">
- <link rel="stylesheet" href="d2.css" type="text/css" media="print">
- <script src="changecurve.js" type="text/javascript" charset="utf-8"></script>
- <script>
- From Step 4 JavaScript copy from there and paste it here.
- </script>
- </head>
- <body>
- <div id="holder"></div>
- </body>
- </html>

After changing the curve positions.

Drawing Bezier Curves in WPF
Position based indexers in C#
Extending ASPX Panel Control to produce Rounded Corners

Join the conversation! Your thoughts help the community grow.