473,612 Members | 2,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How Do I Make The Cropping Of Image ?It Is Not Working.Please Suggest Me

1 New Member
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function onFileLoad(e) {
  3.    var sradha =  $('#cropbox').html('<img src="'+e.target.result +'"/>');
  4.    alert(sradha);
  5.  
  6. }
  7.  
  8. function displayPreview(files) {
  9.     var reader = new FileReader();
  10.     reader.onload = onFileLoad;
  11.     reader.readAsDataURL(files[0]);
  12. }
  13. </script>
  14. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
  15. <script src="js/jquery.min.js"></script>
  16. <script src="js/jquery.Jcrop.js"></script>
  17. <link rel="stylesheet" href="css/demos.css" type="text/css" />
  18. <link rel="stylesheet" href="css/jquery.Jcrop.css" type="text/css" />
  19. <script type="text/javascript">
  20.  
  21.                   $(function(){
  22.  
  23.                     $('#cropbox').Jcrop({
  24.                       aspectRatio: 1,
  25.                       onSelect: updateCoords
  26.  
  27.                     });
  28.  
  29.                   });
  30.  
  31.                   function updateCoords(c)
  32.                   {
  33.                     $('#x').val(c.x);
  34.                     $('#y').val(c.y);
  35.                     $('#w').val(c.w);
  36.                     $('#h').val(c.h);
  37.  
  38.                   };
  39.  
  40.                   function checkCoords()
  41.                   {
  42.                     if (parseInt($('#w').val())) return true;
  43.                     alert('Please select a crop region then press submit.');
  44.                     return false;
  45.                   };
  46.  
  47.                 </script>
  48. <body style="text-align:center; margin-top:50px; width:50%;">
  49. <form action="" method="post" enctype="multipart/form-data" >
  50. <fieldset style="text-align:center; height:200px; color:#0000FF; height:200%; width:188%">
  51. <legend style="border: #0000CC 1px solid;"> Upload Image</legend>
  52. <table width="200" border="0" align="center" cellpadding="6px">
  53.   <tr>
  54.     <td height="20px;">Image</td>
  55.     <br/>
  56.     <td><input type="file" name="image" id="image" onChange="displayPreview(this.files);"/>
  57.     </td>
  58.   </tr>
  59.   <td id="abc"></td>
  60. </table>
  61. <br/>
  62. <input type="submit" value="submit" name="submit">
  63. <br/>
  64. <div  class="imagem_artigo" id="cropbox"></div>
  65.  
  66. <!--<img class='imagem_artigo' src="Lighthouse.jpg" id="cropbox" /> -->
  67. <form action="form.php" method="post" onSubmit="return checkCoords();" enctype="multipart/form-data" >
  68.   <input type="text" id="x" name="x" />
  69.   <input type="text" id="y" name="y" />
  70.   <input type="text" id="w" name="w" />
  71.   <input type="text" id="h" name="h" />
  72.   <input type="submit" value="Crop Image" class="btn btn-large btn-inverse" name="submit" />
  73. <!--  <div id="sradha"> <img class='imagem_artigo' src="Lighthouse1.jpg"   /> </div>-->
  74. </form>
  75. <br>
  76. <br>
  77. </fieldset>
  78. </form>
  79. </body>
Dec 10 '14 #1
1 1442
Dormilich
8,658 Recognized Expert Moderator Expert
please describe how it is not working.
Dec 10 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
1814
by: santanu | last post by:
Hi all, I know a little python (not the OOP part) learnt by studying the online tutorial. Now I would like to learn it more thoroughly. I have access to 'Programming Python' which I liked (on flipping through the pages), but the problem is it deals only with version 2.0 of Phython.
1
1207
by: Support | last post by:
We are a large organization with a number of offices all over the state. All our employees need to access data/update data and generate reports from all offices. Initially our application will be developed on intranet and then it will be uploaded on third party web server/database server so that all employees from all over the state can access it. For this what are the tools and products of microsoft will be
2
1750
by: anton.aleksandrov | last post by:
Hello, First of all - sorry for may be stupid question, but as I am not a Win* administrator and my field is *nix, I am a little bit stuck with a problem, presented to me by one of the customers. He has few windows boxes with some webfile and (most important) - mssql database. And he asks for a backup. I found some company, which offers us IBM's Tivoli software, but my opinion is that they want a little bit too much for it and also, from...
3
1694
by: ashutosh | last post by:
I am working for a company and working for printer drivers. Most of the work is in ddk, VC++ and C++, gdi calls. I have studied C++ and ddk and VC++ is new for me. Can anybody suggest me some good web sites for study, some free tutorials on the net, some easy study material or some certification in this field which will be helpful for me and some good sites from where i can prepare. I am a fresher in the company. Please suggest.
3
1462
by: srikar | last post by:
Hi can any one tell me If we want to print the adress of the object if I type cast in to int on a machine where address and int occupies same size it is not be a problem. If on a machine where adress and int are diffferent assume 64 bit machine If we type cast it to (int *) before printing the address of the object will it give a wrong value. please suggest me the corrrect answer. regards
2
2297
by: astarter | last post by:
Hello friends. I am second year student of Computer engg. in DCE. I want to make some project to hone my programming skills. Please suggest some. I know C,C++, Java( core only) and DS. Any help in this regard is highly appreciated.Please Please Please help me
2
1463
by: only2gayathri | last post by:
Hi all, I have a page(vb.net) which directs to a excel sheet.This excel sheet retains all the values(mainly numbers) from the page and displays it.The problem is that sometimes the number's remain in text format when downloaded to excel and this kind of creates a flag(similar to the one when we add comments in the excel)in some of the cells.This problem occurs only sometimes. Can anyone suggest anyway of overcoming these??Like using a...
2
2060
by: nethravathy | last post by:
Hi, The following table namely elcbtripselect contains 5147 records.I want to know wether this table contains duplicate records or not. I tried with following query 1)SELECT elcbtripselect.ELCBTRIP_voltsMIN, elcbtripselect.ELCBTRIP_voltsMAX, elcbtripselect.ELCBTrip_is_partwinding, elcbtripselect.ELCBTrip_is_ydelta, elcbtripselect.ELCBTRIP_starter_size, elcbtripselect.ELCBTRIP_UnitFunction, elcbtripselect.ELCBTRIP_strcb_speedi_frame_ty,...
0
8615
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8568
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6081
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4047
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4110
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1699
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.