Click here to Skip to main content
15,889,116 members

Comments by LLLLGGGG (Top 167 by date)

LLLLGGGG 27-Jun-18 13:39pm View    
Yeah, as soon as I read "it's quite buggy" I realized I wrote an horrible piece of code. Sorry for that.
Would you mind if I update my answer with your code (using the right attribution, of course)? Unfortunately, I cannot see your name on the comment.
LLLLGGGG 19-Jul-17 13:27pm View    
i tried lot but not reduced to exact 2Mb, and also changed the width,height


That is because it's impossible: you cannot reduce the file size and keep the width, height and quality the same! You can:
1. Reduce width/height
2. Change algorithm for lossy compression (does not necessarily imply a loss of quality, but it means that you need to upload the photo even if it's >2MB and save it again in a new image type) or increase the amount of compression that the algorithm uses (decreases quality and you still need to upload the photo even if it's >2MB)
3. Use a lossless compression after the uploading (GZip algorithm for instance).
LLLLGGGG 19-Jul-17 13:20pm View    
please never abuse of the exclamation mark '!' and please try something before you post the question. To answer you I simply did a quick searching on Google for the Clipboard.GetImage() method. This will reduce the number of downvotes.
LLLLGGGG 18-Jul-17 13:22pm View    
It does not update the element of the array or it updates them but the value is not what you want?
LLLLGGGG 18-Jul-17 13:20pm View    
You could write a simple class like
public class MysteriousType{object o;Type t;} 
and then cast o to the type t... it works, but it's a horrible solution.The best would be writing classes in hierarchy using inheritance and pass an instance of a base class. Then with the is operator you can handle the rest.