x3p_crop | R Documentation |
Cuts out a rectangle of size width x height from the location (x, y) of an x3p object. x and y specify the bottom right corner of the rectangle. In case the dimensions of the surface matrix do not allow for the full dimensions of the rectangle cutout the dimensions are adjusted accordingly.
x3p_crop(x3p, x = 1, y = 1, width = 128, height = 128)
x3p |
x3p object |
x |
integer, location (in pixels) of the leftmost side of the rectangle, |
y |
integer, location (in pixels) of the leftmost side of the rectangle, |
width |
integer, width (in pixels) of the rectangle, |
height |
integer, height (in pixels) of the rectangle, |
logo <- x3p_read(system.file("csafe-logo.x3p", package="x3ptools"))
# crop the x3p file to just the CSAFE logo
logo_only <- x3p_crop(logo, x=20, y=50, width = 255 ,height =310)
logo_only <- x3p_crop(logo, x=20, y=50, width = 255 ,height =510)
# x3p_image(logo_only, size=c(500,500), zoom = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.