Change the shape of jcrop selection - buddypress

I'm working with jcrop inside of BuddyPress and I was wondering how I could go about setting a different selection shape from a square to either a circle or hexagon with a set aspect ratio to meet the profile picture shape.

No ability to crop circles or hexagons - this is a cropper limitation.
BuddyPress Avatar Cropper uses WordPress wp_get_image_editor(). So this can't be changed at this time and WordPress doesn't have ability to crop anything except squares or rectangles.
All the corresponding code is in /buddypress/bp-core/bp-core-avatars.php. See line 550 for BuddyPress 1.7.

Related

UWP and InkToolbar: how to draw basic shapes

I work on a UWP app where the user must be able to take a photo from the camera, and add details by drawing some shapes. I think the simplest way to do this is using the InkToolbar. So I've donwloaded the official sample: SimpleInk
But I don't see how to solve some of my needs:
add a background image to the InkCanvas: I would like get a BitmapImage containing the original photo and the items drawed by the user
=> is it possible to do this properly? or do I need to superpose the Image and the InkCanvas in the Grid and take a screenshot?
draw basic shapes like circles or rectangles: all the samples are based on hand drawing with different kinds of pencils
=> is there a way to draw shapes like circles or rectangles through this control? or what is the better way for allowing user to "draw" shapes easily?
I also looked at the Win2D samples Win2D-samples, but I didn't found a similar case.
Thanks in advance for your feedbacks!
add a background image to the InkCanvas: I would like get a BitmapImage containing the original photo and the items drawed by the user
The InkCanvas doesn't contain a background property directly. You can create an InkCanvas overlays a background image by using an Image control like the Basic inking with InkCanvas sample shows.
But if you need to get a new BitmapImage from original image with InkCanvas drawing you need to use the Win2D library. For more details and a completed demo please reference this thread.
draw basic shapes like circles or rectangles: all the samples are based on hand drawing with different kinds of pencils
For this, the UAP sample of Win2D-samples you mentioned above provided a demo for drawing a circle you can reference(same with rectangles like follows).
args.DrawingSession.DrawEllipse(155, 115, 80, 30, Colors.Black, 3);
args.DrawingSession.DrawRectangle(155, 115, 80, 30, Colors.Black);
The official Complex inking sample also provide the Insert a shape feature you can test and reference.

Diamond shapes within Revolution slider

I tried to create diamond shape images into the Slider Revolution like you can see ​here. Unfortunately I cannot figure out how to create diamond images in Slider Revolution.
Actions:
I created custom square shape in Slider Revolution.
I rotated the square shape 45 degrees. So far so good!
I changed background of square with layer CSS:
{background-image: url("../wp-content/uploads/2016/04/SBLi-brand-signs-G-STAR-RAW.jpg");}
Result:
1.. Background image viewed in slider-revolution customizer but not on front-end website.
2. Background image rotated together with the square, how do I rotate back the background or is there a smarter, easier way to create diamond images in Slider Revolution?
I attached a image for better understanding of my diamond image issue :)

PDF - Mass cropping of non-whitespace application

I have about 400 pdfs with a lot of dead space between the text and the page border.
Usually I'm using govert's pdf cropper to crop all the whitespace, but this time the pdf background color is (darn!) yellow,
and no software which I know (and I've searched for quite a while) can crop non-whitespace
(well, except maybe pdfcrop.pl -a Pearl library which supposedly can remove black spaces).
Anybody knows of a software that can perform such task?
The ideal app, I guess, would have the option to receive specific color to remove,
like rgb(192,192,192).
Thanks in advance.
The reason this is so difficult is that PDF has no concept of paper color or background color. So what you're seeing is not a different background color, but an object (typically a rectangle) painted in that yellow background color.
Most cropping tools simply calculate the bounding box of all objects on the page and then crop away everything outside that bounding box. Of course that doesn't work for your file because the bounding box will include the background rectangle object.
There are potentially a number of directions you could take this:
1) If all pages need to be cropped by the same amount, you could attempt to do cropping that way (simply passing a rectangle to the cropping tool to do the actual cropping).
2) There are tools (callas pdfToolbox - watch it, I'm associated with this tool, Enfocus PitStop...) that allow you to remove objects from a document and this could be done by specifying your yellow color. This would allow you to modify the PDF file by removing the background object and then perform the cropping you want to perform.

WP8 tile design

Can't figure out how do I prepare the images for the Iconic tile on WP8. The guide is here. My tile is very simple - no counter, no variable text. Just the image and the app title.
So I should provide two image files - IconImage and SmallIconImage (the XML elements in the manifest are called differently, by the way). But which size should I make them? The guide says the tile is 159x159 and 336x336, respectively; but the icon within the tile is 110x110 and 202x202. The rest is text and counter, as overlaid by the Windows Phone shell.
Which size should I use for my two images? Should I just draw the icon, or a larger image some blank space and the icon in the required boundaries?
EDIT: relevant discussion here.
The correct size would be:
Small: 72×110
Medium: 132×202
You can find more details here http://mikaelkoskinen.net/windows-phone-8-iconic-tile-image-size-comparison
The guide is showing that you make your icon 110x110 and 202x202. The 159x159 and 336x336 shown in the guide are noted for the size of the tile. If you want to use the Iconic Template, you do not create the entire tile like you used to. Instead you designate the icon to be used within the tile. Search for "icon" within this link. http://www.developer.nokia.com/Community/Wiki/What%27s_new_in_Windows_Phone_8

Camera image size

I am writing a Cocoa application for mac osx. I'm trying to figure out how to determine the size of an image that will be captured by a camera? I would like to know the size of the image that will be captured so I can setup a view with an aspect ratio that won't distort the image. For example, if my view is defined to be 640x360 and my camera captures images that are 640x480, the displayed image looks short and fat. I'm also displaying some other layers over the image and I need the image size to be able to scale and position the layers properly.
I won't know the type of camera that is attached until run-time so I'd like to be able to interrogate the device and get attributes like image size. Thanks for the help...
You are altering the aspect ratio of the image when you capture in 640x360 instead of 640x480 or 320x240. You are doing something similar as a resize, using the whole image and making it a different size.
If you don't want to distort the image, but use only a portion of it you need to do a crop. Some hardware support cropping, others don't and you have to do it in software. Cropping is using only portions of the original image. In your case, you would discard the bottom 120 lines.
Example (from here):
The blue rectangle is the natural, or original image and the red is a crop of it.