For multiple users, the Avatar upload function is implemented. PHP Code is applicable to login page creation and Avatar page creation.
To put it bluntly, a website is a combination of several specific functions, and changing user portraits is included in these functions. Let's take a test today to implement the Avatar upload function for different users.
--------
Crop an html5 uploaded Avatar and an html5 Avatar
In this example, HTML5 canvas is used to write the cropping effect of the uploaded avatar. You can drag and drop the uploaded avatar to crop it. Although the style is not easy to see, the function is still complete:
For the effect after cropping:
Html section:
JavaScr
// Pop up the actionsheet. Select how to get the Avatar// Obtain the image from the album-(void) takePictureClick :( UIButton *) sender {// * Note: to use it, you must implement the following protocol: UIImagePickerControllerDelegate, // UINavigationControllerDelegate // * // UIImagePickerController * picker = [[UIImagePickerController alloc] init]; // sets the image source (album) // picker. sourceType = UIImagePickerControllerSourceTypeSavedPhotosAl
Php: Create an instance of a circular user avatar _ custom encapsulation class source code, circular user avatar
Ideas
Three image layers must be created for the layer design.
1. Bottom Layer: The final generated image
2. Real user profile pictures: real profile pictures uploaded by users as intermediate layers
3. Circular mask: as the top layer, draw a circular area in the mask and set it to transparent.
"Avatar" originated from the Indian Sanskrit and is intended to refer to "Separation and embodiment ". In the Internet era, avatar has become synonymous with virtual roles (virtual images in the image-dominated virtual world. If the embodiment of a user is the user's own, it will increase the user's sense of substitution in the virtual world. For example, in MMORPG, if users see themselves as a generation o
Solution:
1. Change a picture again, the picture size is bigger than 240x240 on the line.
2. Personal Settings-Avatar settings-upload pictures. There are no size requirements for uploading pictures here!
The second method very few people know oh, this method is very good to solve the picture is too small problem, small series selfless will method to everyone, hope everyone can upload their favorite avatar
1. You want to ensure that your QQ is the latest version, if not I click to upgrade QQ to the "latest version", Specific: We click on the QQ interface "about"-"Version Update" button, in order to obtain the latest version of the mobile phone QQ program.
2. Good QQ to the latest version after we click on "I"-"expression, Bubbles, theme" click it into.
3. Then we click on the "expression, bubble and theme" You will see there is a "Avatar pendant
Php creates a circular user avatar-custom encapsulation class source code and a circular user avatar
Ideas
Three image layers must be created for the layer design.
1. Bottom Layer: The final generated image
2. Real user profile pictures: real profile pictures uploaded by users as intermediate layers
3. Circular mask: as the top layer, draw a circular area in the mask and set it to transparent.
The Code is
Php implements the Avatar upload preview function, and php Avatar upload Preview
The example in this article shares with you the specific code for php to implement the Avatar upload preview function for your reference. The specific content is as follows:
Home Page 1.php
Processing page 2.php
Show:
Click the image position to display the selection box:
After
is uploaded successfully,
Size is the scaling ratio, default is 1, there are thumbnails when the magnification is reduced, if the thumbnail to the original 3/4,size 0.75
msg If result=1,msg is a file address, if RESULT=0,MSG is an error message
W,h is the height of the original image, and if there is a thumbnail, the thumbnail is wide.
Four, select the picture area
Avatar target size is 175*175 and is
1, in the mobile phone we open Alipay and then we click on "My" and then we click the "Personal Center" effect is shown below.
2, then we in the Open list interface, click the "Account Details" effect as shown below.
3, after we found the interface of the "Avatar" effect as shown below
4, then we click on the set avatar, you can choose to use an instant photo or choose from a photo
Avatar upload plug-in and Avatar plug-in
Uploading headers are a complicated task. Recently, I have helped my friends find a plug-in to share with you.
Ps: You can write various styles based on your design draft without any fixed plug-in styles;
Demo address: http://durenlong.gitee.io/uploading
Code address: https://gitee.com/durenlong/uploading
Ps: there are only four key tags that correspond to each ot
Php funny Avatar puzzles, php Avatar puzzles
When studying the GD library of php, I found a piece of code written by others. Here I hope to increase everyone's enthusiasm for php. This code mosaic the person's profile picture, which looks interesting.
function pixelfuck($url, $chars='ewk34543§G§$§$Tg34g4g', $shrpns=1, $size=4,$weight=2){ list($w, $h, $type) = getimagesize($url); $resource = imagecre
Custom avatar processing is lightweight and practical. There are a lot of powerful tips in it. Come and praise me ^ _ ^, Avatar tipsThe Method Code introduced in this article is all the key points. If you need other things, complete them by yourself.
Note that in the Code on the following page, every comment is basically a practical, powerful, and interesting technique !! Will anyone be excited when I see t
Method One, through the public number to operate
1, we open in the phone "micro-letter" and then enter the "subscription number" as shown in the following figure.
2, then in the open "subscription number" We go to search "Songjiang micro-life" to find "Songjiang micro-life" this page.
3, and then find "Songjiang micro-life", send you need to add a picture of V, and then need to wait for the "success Plus v" response, download plus V of the picture, and then replace your micro-letter
1, we first download a "Beauty Mito" installed in the computer, and then open the United States Mito click on "New" a canvas, and then set a color, as shown in the following figure.
3, then we click on "crop," save.
4, then we import the avatar, and then we then right button, and then the picture import after we click Settings, transparency
5, then we click enter "text" after setting the font position
6, then we cli
1 in the mobile phone first open "beautiful said" and then we log in after the beauty of the said click "I" specific as the figure.
2 in access to my interface we will see an account, and then we click on the "account" to enter after we click on the "Avatar" can be.
3 OK to enter the selection of photos we can from the phone album to find and can immediately use the "take photos" to the photo, this custom bar. As I now choose from the phone's al
Python Concatenates the full avatar of a friend and the python avatar.Full portrait of friends
Let's just talk about the code.
Import itchatimport mathimport PIL. image as Imageimport ositchat. auto_login () friends = itchat. get_friends (update = True) [0:] user = friends [0] ["UserName"] num = 0for I in friends: img = itchat. get_head_img (userName = I ["UserName"]) fileImage = open ('Folder '+ "/" + str (num) + ". jpg ", 'wb ') fileImage. write (im
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.