Advertisement
Advertisement
| 03.19.2008 at 12:51PM PDT, ID: 23254922 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133: 134: 135: 136: 137: 138: 139: 140: |
<%@ Page Language="C#"%>
<%@ Import Namespace = "System"%>
<%@ Import Namespace = "System.IO"%>
<%@ Import Namespace = "System.Drawing"%>
<%@ Import Namespace = "System.Drawing.Imaging"%>
<%@ Import Namespace = "System.Drawing.Text"%>
<%@ Import Namespace = "System.Drawing.Drawing2D"%>
<script runat="server">
/* Code for File Upload button*/
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile)
try {
FileUpload1.SaveAs("C:\\wamp\\www\\SampleASP\\Upimag\\" + FileUpload1.FileName );
Bitmap bm = new Bitmap(FileUpload1.PostedFile.FileName);
bm.Save("C:\\wamp\\www\\SampleASP\\Upimag\\samsif.gif",ImageFormat.Gif);
}
catch (Exception ex) {
Label1.Text = "ERROR: " + ex.Message.ToString();
}
else
{
Label1.Text = "You have not specified a file.";
}
}
/* Code for Upload settings button*/
/* protected */ void Button2_Click(object sender, EventArgs e)
{
try {
System.Drawing.Rectangle cropArea = new System.Drawing.Rectangle();
Label2.Text ="received ." + rect.Value +" " + rect.Type;
cropArea = rect.Value;
string inpath = Server.MapPath("Upimag/samsif.gif");
string outpath = Server.MapPath("Upimag/1.Gif");
Bitmap bmpImage = new Bitmap(inpath);
Bitmap bmpCrop = bmpImage.Clone(cropArea,bmpImage.PixelFormat);
bmpCrop.Save(outpath);
}
catch (Exception ex) {
}
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server" ID="Head1">
<link rel="stylesheet" type="text/css" href="style.css"/>
<script src="cropperlib/prototype.js" type="text/javascript"></script>
<script src="cropperlib/scriptaculous.js?load=builder,dragdrop" type="text/javascript"></script>
<script src="cropperlib/cropper.js" type="text/javascript"></script>
<script type="text/javascript" src="upload.js"></script>
<link rel="stylesheet" type="text/css" href="./cropperlib/debug.css" />
<title>FileUpload Server Control</title>
</head>
<body class="ctrl"><div id="container">
<div id="header">
<h1> Upload and mark an Instruction image for split Settings</h1>
<form id="form1" method="post" runat="server" enctype="multipart/form-data">
<asp:FileUpload ID="FileUpload1" runat="server" />
<p>
<asp:Button ID="Button1" runat="server" Text="Upload" OnClick="Button1_Click" /></p>
<p> <asp:Label ID="Label1" runat="server"></asp:Label></p>
<!-- Upload Settings button-->
<input type="hidden" id="rect" NAME="rect" runat="server" />
<p > <asp:Button ID="Button2" runat="server" Text="Upload Settings" OnClick="Button2_Click" /></p>
<p> <asp:Label ID="Label2" runat="server"></asp:Label></p>
</form>
<!--FORM1 for file and Split setting upload-->
<div id="report">
<p> <label for="x1">x1: </label> <input type="text" name="x1" id="x1" />
<label for="y1">y1: </label> <input type="text" name="y1" id="y1" /> </p>
<p> <label for="x2">x2: </label> <input type="text" name="x2" id="x2" />
<label for="y2">y2: </label> <input type="text" name="y2" id="y2" /> </p>
<p> <label for="width">width:</label> <input type="text" name="width" id="width" />
<label for="height">height:</label> <input type="text" name="height" id="height" /> </p>
</div> <%--//Report Div Closes--%>
</div> <!--Header Div Closes-->
<div id="rightpan"> <!--To display block of splitted images-->
<!-- <img class="imgsplit" src=""/>-->
</div>
<div id="testWrap"> <!-- TO display instruction image-->
<img src="Upimag/samsif.gif" id="testImage"/>
</div>
</div>
<script type="text/javascript" charset="utf-8">
// setup the callback function
function onEndCrop( coords, dimensions ) {
$( 'x1' ).value = coords.x1;
$( 'y1' ).value = coords.y1;
$( 'x2' ).value = coords.x2;
$( 'y2' ).value = coords.y2;
$( 'width' ).value = dimensions.width;
$( 'height' ).value = dimensions.height;
}
// basic example
Event.observe(
window,
'load',
function() {
new Cropper.Img(
'testImage',
{
onEndCrop: onEndCrop,
displayOnInit: true,
onloadCoords: { x1: 10, y1: 10, x2: 250, y2: 100 }
}
)
}
);
if( typeof(dump) != 'function' ) {
Debug.init(true, '/');
function dump( msg ) {
Debug.raise( msg );
};
} else dump( '---------------------------------------\n' );
document.getElementById('rect').value = coords;
</script>
</body>
</html>
|