How to export image (png) containing black rectangle - react-native

I have Image, that I made with phone Camera. I need to make some censoring and place black rectangle into Image. I want to create png Image containing black rectangle, that I can send to Backend server.
I know react-native-view-shot
but it only snaps whole display and result is in low resolution.
Is there some other way how to do it? I need to place rectangle into the original image source, not into display snapshot.

Related

Draw with mouse and save the drawn region as separate image

Please see following picture:
background picture
The image Abc in red color is the background picture, maybe preloaded on some control, for example a picturebox control.
The black rectangle region is drawn using mouse. What I want to achieve is to copy out the drawn region as separate image.
My goal is the winform will display each mouse drawing stroke until there is a closed region being formed or enclosed. That means a closing contact point need to be tracked.
Could you advise me on the key classes that I need to look into?

fit multiple images on background image using imagemagick

I am trying to use image magic to do the following:
I have pdf with multiple pages, I want to convert them into JPG.
I have a background image with fixed width and height which will work as a container.
I want to place each of the converted JPGs alone on the background image and fit it on the background image with stretching and keeping the image proportion, so the background image will fill the empty space around it.
I want to save the result image as JPG in two different specific sizes.
How could I do that?

Circular images

In my application, users are allowed to choose a picture they want and this picture shows up in a picturebox.
I want to know if there was a way so that this picture that they select becomes circular instead of a square?
I want all images they select to be circle shaped.
Is there anyway to do this? Doesn't even have to be a picturebox control, anything that can accomplish this is fine
I tried this with no luck - http://www.codeproject.com/Questions/430531/circle-shaped-picture-box
Not the smartest way, but worked for me in similar task. If your picturebox is fixed size, you can create "mask" which will hide the corners.
Just draw an image in PNG with transparent circle in the middle and make the rest same color as your form. Use this image as Image propperty of each imagebox and set your image as "backgroundImage" property. This way, the image will look circle-shaped.
If you need imageboxes of different size, you can create the circle mask programmatically.
EDIT: If you will prepare a calculation of circle, you can also use it to "crop" the images to circle shape. It all depends on what you want to do with these images later.
Do you need to use them later in circle or rectangle shape?

transsparency issue with PNG images

I need to display PNG images with transparent background.
in OpennetCF.Button2:
btn.ImageList = ilIcons;
btn.ImageIndex = (int)ImageIndex;
and PictureBox
pbMyPB.Image = (Image)_ResourceManager.GetObject("MyImage");
Some images are displayed correctly, but some images are shown with black background.
How can I fix it?
In your images, do they all share a similar background color?
For instance, all of my images have a White or semi-transparent background and go onto a White canvas:
So, if your image is going onto a Button, you might need to try to find or create some images that match your Button's color or change your Button color to match up with the background colors of your items.
Hope this helps.
Joe

How to create letterpress effect?

I'm looking to implement something like the famous "letterpress" effect in my application. Here's what I'm talking about: (just a quick example made in PShop)
As you can see, it looks like it's pressed into the background. I wonder if it's possible to do something like this on the Mac dynamically. Is there a way? Thanks!
You can do the gradient fill portion of the text using the code I provide in this answer. Check the coordinate space first, because I described that for the iPhone, which has an inverted Y axis when compared to the Mac's normal Quartz coordinates.
The text is first used to create a clipping path, and the gradient is drawn within that path.
As far as the internal shadow, you might be able to draw this after the gradient is drawn by using CGContextSetShadowWithColor() with an appropriate downward offset and black color, then drawing the text again using just the stroke of the text. deanWombourne has some sample code for a similar task in his answer here.
Draw the text with a normal font to create a black and white bitmap of the text.
Draw another image that is is the same size and completely filled with the gray-to-white gradient you have above.
Create a completely white image with the same size as your other images.
Draw your back and white text image (1) onto the white image (3) with NSCompositeDestinationOut.
This gives you a white image with your text cut out.
Draw the white image with the text cut out on top of the gradient image and apply a shadow while drawing.