In the project. We need to do something like Avatar upload, image clipping function, OK to see the following articles!plugins required:jQuery jcropBack-End Code:Package Org.csg.upload;import Java.awt.rectangle;import Java.awt.image.bufferedimage;import java.io.File;import Java.io.fileinputstream;import Java.io.ioexception;import Java.util.iterator;import Javax.imageio.ImageIO;import Javax.imageio.imagereadparam;import Javax.imageio.imagereader;import
Today I was crazy to learn the image clipping effect on the front end of the web, you can have an area to frame a part of the picture, and you can preview the part of the box
The effect chart is as follows:
Isn't it cool to watch?
Simply introduce the implementation method
1. The layout is about two pieces of Div, the right side of the story, mainly on the left, the left with the absolute layout of the way 3, the bottom layer is a translucent pi
1. The foreground unfolds realizesFind this jquery online. Jcrop, a little look, found that it provides the effect can fully meet the project requirements.
Official website: http://deepliquid.com/content/Jcrop.html, interested friends can go and see.
The page first references the related styles and scripts:
Copy Code code as follows:
The body part of the page code:
Copy Code code as follows:
The value of the width and height of the style with I
Train of thought: Js,jquery can't achieve the clipping of the picture, just show an illusion
My approach to implementation is as follows:
1. Upload the user selected picture to the server
2. The selected avatar of the rectangular frame in the picture coordinates sent to the server, including, rectangular box width, high, upper left corner of the x,y coordinates, the picture of high, wide and so on
3. Use the obtained coordinate values on the server,
-angle distortion.
is still just the page, then we can adjust the "remove distortion", "vertical Perspective", "horizontal perspective" to fine-tune, while the grid line with the alignment. Here it is necessary to explain, in the lens distortion dressing function, ps than the light magic hand to fine, the effect is more perfect. The modified effect is as follows:
4, such as proportional reduction.
First select the rectangular Marquee tool
method fillet in the outline class. The default schema provider's comments get a background outline from the view. To prevent the shadow from being shadowed, set its profile provider to NULL.Cut viewCrop view, you can easily change the shape of the view. You can change the view consistency with other design elements or change the shape of the diagram in response to user input. You can clip to use the View.setcliptooutline () method or the outline area of Android: Cliptooutline property. Only re
Unscale
Reverse operation of Scale
Deleteselection
Delete the check box and focus on the first created box
Animateto
Create a new box in an animated form
Setselect
Settings box
Getcontainersize
Get the dimensions of a container
Resizecontainer
Adjust the width and height of the container
SetImage
Set the Jcrop bound image, you can use this function to chang
ObjectiveThe Android 5.0 knowledge point is finished, the next one to bring you a comprehensive example of the demo, and talk about my view of Android 5.0. Some people will think why not every blog with a demo, I think no matter what to learn everything needs to practice, so I did not provide demo, I would like to first let everyone own to follow the steps I wrote to achieve this, in the process of implementation will encounter difficulties, and then go to find solutions, Finally, do it yourself
This article describes the PHP picture clipping and scaling example, not much nonsense, the specific code is as follows:
/* *exif_imagetype--Determine the type of an image * Function Description: function is to cut an image into an image of any size, and keep the image is not deformed * parameter description: Enter the file name to process the picture, generate a new picture of the saved file name, create a new picture of the width of the new image t
$src _path = ' 1.jpg ';
Create a source diagram instance
$SRC = imagecreatefromstring (file_get_contents ($src _path));
Crop the coordinates of the point in the upper-left corner of the open area
$x = 100;
$y = 12;
Width and height of clipping area
$width = 200;
$height = 200;
Finally save the width and height of the picture, and the source to equal proportions, otherwise it will d
The clip property is used to set the shape of an element. Used to trim an absolutely positioned element (absolute or fixed).
There are three types of clip values:auto |inherit|rect. Inherit is inherited, IE does not support this property, auto is the default first two basic belongs to soy sauce, we mainly say clip's Rect property.
the Rect property of clip: clip:rect (top,right,bottom,left) Four attribute values are indispensable;
How exactly are these four attribute values calculated? Look at
('Onpropertychange', propertychangeevent); - }Else{ to if(window.attachevent) {//IE + Oipt.attachevent ('Oninput', inputevent); - if(!window. ScriptEngineMinorVersion ()Window.addeventlistener) { //IE9 the Alert ('IE9'); //This frame is only available when the IE9 page is initialized * Oipt.attachevent ('onkeyup', function(e) { $ if(E.keycode=== 8){Panax Notoginseng //Delete--Trigger - Oipt.fireevent ('Oninput'); the
Always use Ccnode as a container for UI elements, such as an underlined text, I'll add a label and a sprite to a ccnode and then as a whole.In the main interface when chatting with a problem, a chat message needs to be composed of a number of different elements, and the main interface only can display a text message of no more than 16 words. The idea at first is to write an algorithm that starts with the first element and traverses to the last element,Add the word count until 16 words, but this
1. Merger: Arctoolbox->datamanagement->raster->mosaic. 2. Cut: in ArcMap, call the spatial analysis extension to set the Shapefile polygon layer of your area of interest as a mask (the drop-down menu of the spatial Analyst toolbar is set in >option), then recalculate your image in the raster calculator, It will be cut along the mask.
650) this.width=650; "src=" http://www.dsac.cn/file/attached/image/20141203/20141203102607_8937.jpg "width=" 479 " height= "257"/>
650)
First, there's a 200*200 rectangle that's green.Then crop the 50*50. The arc below is only in the 50*50 area.And then switch back to 200*200.And then the blue Circle saw it again.That's probably what it means.I've been busy interviewing for so long that I don't have time to tidy up my canvas!Now start to organize!!!HTML5 Canvas Clipping Area
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.