api pictures - TouchDevelop

Download Report

Transcript api pictures - TouchDevelop

api
pictures
view picture
Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet
Web site references, may change without notice. You bear the risk of using it. This document does not provide you with any legal rights
to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. ©
2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and Windows Live are trademarks of the Microsoft group of
companies. All other trademarks are property of their respective owners.
touchdevelop api
pictures
o
Windows Phone built-in notion of
“pictures”
o
sync pictures with Zune
o
take new pictures with camera
o
manipulate pictures in code
touchdevelop api
apis
o
o
o
o
o
o
o
Senses→take camera picture
Takes a picture and returns it.
Media→choose picture
Chooses a picture from library
Contact→picture
Gets the picture a contact
Media→create picture
Creates a new picture
Media→pictures
Gets pictures on phone
Media→picture albums
Gets the picture albums
Media→saved pictures
Gets the saved pictures on
phone
o
o
o
o
Media Server→choose
picture
Chooses a picture
Media Server→search
pictures by date
Searches for pictures in a
particular date range.
Media Server→pictures
Gets a list of all pictures
Web→download picture
Downloads a picture from
internet
touchdevelop api
apis
o
Pictures→at
Gets the item at position 'index'; invalid if index is out of bounds
o
Pictures→count
Gets the number of elements in the collection
o
Pictures→find
Finds a picture by name and returns the index. Returns -1 if not
found.
o
Pictures→thumbnail
Gets the thumbnail of i-th picture.
o
Pictures→random
Gets the item at a randon position; invalid if collection is empty
o
Pictures→post to wall
Displays the picture thumbmails to the wall
touchdevelop api
apis
o
Picture Album→name
Gets the name of the album
o
Picture Album→pictures
Gets the pictures
o
Picture Album→albums
Gets the children albums
o
Displays the value to the wall
o
Picture Album→post to wall
Displays the album to the wall
touchdevelop api
apis
o
o
o
o
o
o
o
o
o
o
o
o
o
Picture→width
Picture→height
Picture→set pixel
Picture→pixel
Picture→draw text
Picture→fill rect
Picture→draw line
Picture→draw rect
Picture→draw ellipse
Picture→fill ellipse
Picture→resize
Picture→clear
Picture→clone
Picture→blend
o
o
o
o
o
o
Picture→location
Gets the location where the picture was taken; if
any.
Picture→is panorama
Indicates if the picture width is greater than its
height
Picture→date
Gets the date time where the picture was taken; if
any.
Picture→post to wall
Displays the image to the wall; you need to call
'update on wall' later if you want changes to be
reflected.
Picture→update on wall
Refreshes the picture on the wall
Picture→save to library
Saves the picture to the 'saved pictures'
album.api
touchdevelop
Returns the file name.
apis
o
o
o
o
o
o
o
o
Picture→colorize
Recolors the picture with the background and foreground color, based on a color threshold
between 0.0 and 1.0
Picture→desaturate
Makes picture gray
Picture→share
Shares this message ('' to pick from a list)
Picture→crop
Crops a sub-image
Picture→invert
Inverts the red, blue and green channels
Picture→tint
Converts every pixel to gray and tints it with the given color.
Picture→brightness
Changes the brightness of the picture. factor in [-1, 1].
Picture→contrast
Changes the contrast of the picture. factor in [-1, 1].
touchdevelop api
examples
o
gray picture
☁ http://touchdevelop.com/yprb
o
media: pictures
☁ http://touchdevelop.com/paqt
o
go to picture
☁ http://touchdevelop.com/gpona
touchdevelop api
exercises
►create a picture; draw a circle by only
using ‘set pixel’ (not ‘draw circle’);
sin α
α
cos α
tip: use loop and sin/cos
touchdevelop api
homework
►finish exercise at home
touchdevelop api