How to add Multiple Texts over image in react native? - javascript

Hello guys
I'm making a simple image editor in react native. In which I'm adding multiple text over a image. But as soon as I added one more text over image, the all text comes to an initial position, but I want to place them as where they were before.
Like in PicsArt
where we can add multiple text over image and all the text have their position where they moved or dragged and resized. When the new text is added, previous text have their previous position.
How to do that?

Related

How to create a specific type of image slider for my webpage

I am trying to create an image slider on my webpage that looks similar to the screen you get when you want to see all the apps open in the background of your phone, a la below:
What I want would look very similar to that. I just want the images to be tighter together and horizontal instead of vertical.
Here is a better example:
So, as you can see I have my webpage with the title at the very top and then below that I have all of my images. This is how I want it to look but I also want these images to enlarge if the user hovers over them. When enlarged the image will stay in place and text will appear on the image which the users can read.
Here is another example:
So in the image above, the user has hovered over the image and now it is displaying information and the other images are pushed to the side. The example text is the title text, background image is just the image the user hovered over and the information text is, as the name suggest, the text that gives info.
So my main question here is how I would achieve something like this?

how to add text on top of image in fabric js stack?

I have created image layer and text layer using fabric js api. Always text layer is behind the image layer. How to bring the text layer in front?
To bring text layer on top of image layer. Like z- index in css.
You need to set sendtoBack for image. Then text layer will be in front. canvas.sendToBack(img);
Try reversing the order you are creating the objects. For the text to appear in front of the image, add image object first followed by the text object.

Editable Text Over Image

I was wondering, is there a way of getting text to go over an image, but have it so that the text can be changed without going into the html, aka using a textbox from a form displayed on the webpage, and the inputted text being put on the image? i know it can be done but im struggling on where to start, and any reply pointing me in the right direction would be most gratefully recieved.
Gareth
If browser compatibility is not an issue, this can be done with HTML5 like so:
<div contenteditable="true">
This text can be edited by the user.
</div>
Then you could either set the image as the background image for that div, or place the image within that div but set the z-index lower than that of the text.

How to remove text over an image from Canvas

After searching for placing text over an image in Canvas I found this snippet
jsfiddle.net/m1erickson/pQYz9/ (found it on stackoverflow, I lost the question)
This snippet places any amount of text over an image. Is it possible to show a cross over each textbox? so that I can remove the selected text by pressing it. The closet answer I found is on this post. But this post talks about clearing the whole canvas and redrawing everything except for the item that you want to remove.
how to remove text from canvas in javascript
My end goal is to have have an app where you can upload an image as a background, place some text on it anywhere you want and then save that canvas as an image.

jquery java script image shade

I have an image and I want to restrict the clickable area on this image. I want user to click only particular area. I want to obtain a darker view out side of this clickable area. How could I achieve this usin java script and/or jquery.
Kind regards
There are many ways to implement the clickable area:
using image map :
http://en.wikipedia.org/wiki/Image_map
Take a look at this website : http://odyniec.net/projects/imgareaselect/
or using divs and z-index.
It might be difficult, but if you use a to determine a clickable area first, you can use jquery to do something like this:
On hover over the mapped area, Show a transparent black div, the same size as the image. (This makes the image darker)
Place another div on top of that, with the same dimensions as the image. (this contains the small map-sized container for the new image)
Place another div INSIDE of the last to be the same size and position as your mapped area. (This will contain the original image - not darkened)
Place the image again INSIDE of the last div and position it so it lines up with the original image.
This should show something like what you're talking about.
If it's more complicated than this, I'm sure we will ALL need an example and all of the outcomes of these images. I don't think there's enough detail to give you a real answer.

Categories

Resources