Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
QuestionRe: how to use jcrop while uploading image Pin
Richard MacCutchan31-May-16 21:03
mveRichard MacCutchan31-May-16 21:03 
AnswerRe: how to use jcrop while uploading image Pin
Member 1255141831-May-16 21:10
Member 1255141831-May-16 21:10 
GeneralRe: how to use jcrop while uploading image Pin
Pete O'Hanlon31-May-16 21:20
mvePete O'Hanlon31-May-16 21:20 
GeneralRe: how to use jcrop while uploading image Pin
Member 125514181-Jun-16 1:01
Member 125514181-Jun-16 1:01 
GeneralRe: how to use jcrop while uploading image Pin
Pete O'Hanlon1-Jun-16 1:07
mvePete O'Hanlon1-Jun-16 1:07 
GeneralRe: how to use jcrop while uploading image Pin
Member 125514181-Jun-16 3:40
Member 125514181-Jun-16 3:40 
GeneralRe: how to use jcrop while uploading image Pin
Pete O'Hanlon1-Jun-16 5:31
mvePete O'Hanlon1-Jun-16 5:31 
GeneralRe: how to use jcrop while uploading image Pin
Member 125514181-Jun-16 20:35
Member 125514181-Jun-16 20:35 
HTML
<script type="text/javascript"></script>
<script src="~/Scripts/jquery-1.10.2.min.js"></script>>
<script src="~/Scripts/jquery.Jcrop.js"></script>
<script src="~/Scripts/jquery.Jcrop.min.js"></script>
<link href="~/Content/jquery.Jcrop.min.css" rel="stylesheet" />

<form id="form1">
    <input type='file' id="imgInp" />
    <img id="blah" class="crop" src="#" alt="your image" />
    <input type="hidden" id="x" name="x" />
    <input type="hidden" id="y" name="y" />
    <input type="hidden" id="w" name="w" />
    <input type="hidden" id="h" name="h" />
</form>

<style>
    #blah {
        background-color: #FFF;
        width: 500px;
        height: 330px;
        font-size: 24px;
        display: block;
    }
</style>






function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();

reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
$('.crop').Jcrop({
onSelect: updateCoords,
bgOpacity: .4,
setSelect: [100, 100, 50, 50],
aspectRatio: 16 / 9
});
}

reader.readAsDataURL(input.files[0]);
}
}

$("#imgInp").change(function () {
console.log(this);
readURL(this);
});

function updateCoords(c) {
console.log(c);
$('#x').val(c.x);
$('#y').val(c.y);
$('#w').val(c.w);
$('#h').val(c.h);
};







By using this i'm getting "Uncaught TypeError: $(...).Jcrop is not a function"
How could I solve this?
GeneralRe: how to use jcrop while uploading image Pin
Pete O'Hanlon1-Jun-16 22:00
mvePete O'Hanlon1-Jun-16 22:00 
GeneralRe: how to use jcrop while uploading image Pin
Richard Deeming2-Jun-16 2:06
mveRichard Deeming2-Jun-16 2:06 
GeneralRe: how to use jcrop while uploading image Pin
Member 125514182-Jun-16 2:14
Member 125514182-Jun-16 2:14 
GeneralRe: how to use jcrop while uploading image Pin
Richard MacCutchan31-May-16 21:24
mveRichard MacCutchan31-May-16 21:24 
Questionc# string.IsNullOrEmpty Pin
aspkiddy31-May-16 6:59
aspkiddy31-May-16 6:59 
AnswerRe: c# string.IsNullOrEmpty Pin
Eddy Vluggen31-May-16 19:40
professionalEddy Vluggen31-May-16 19:40 
GeneralRe: c# string.IsNullOrEmpty Pin
Bernhard Hiller31-May-16 23:55
Bernhard Hiller31-May-16 23:55 
GeneralRe: c# string.IsNullOrEmpty Pin
Eddy Vluggen1-Jun-16 0:04
professionalEddy Vluggen1-Jun-16 0:04 
GeneralRe: c# string.IsNullOrEmpty Pin
V.1-Jun-16 1:19
professionalV.1-Jun-16 1:19 
GeneralRe: c# string.IsNullOrEmpty Pin
Bernhard Hiller1-Jun-16 4:07
Bernhard Hiller1-Jun-16 4:07 
AnswerRe: c# string.IsNullOrEmpty Pin
V.31-May-16 20:09
professionalV.31-May-16 20:09 
GeneralRe: c# string.IsNullOrEmpty Pin
Richard Deeming1-Jun-16 1:30
mveRichard Deeming1-Jun-16 1:30 
GeneralRe: c# string.IsNullOrEmpty Pin
V.1-Jun-16 1:32
professionalV.1-Jun-16 1:32 
GeneralRe: c# string.IsNullOrEmpty Pin
aspkiddy1-Jun-16 2:50
aspkiddy1-Jun-16 2:50 
QuestionRe: c# string.IsNullOrEmpty Pin
Eddy Vluggen1-Jun-16 2:52
professionalEddy Vluggen1-Jun-16 2:52 
AnswerRe: c# string.IsNullOrEmpty Pin
aspkiddy1-Jun-16 3:05
aspkiddy1-Jun-16 3:05 
GeneralRe: c# string.IsNullOrEmpty Pin
Eddy Vluggen1-Jun-16 5:00
professionalEddy Vluggen1-Jun-16 5:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.