Image as smaller bits of image [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have an image . I want the image to be split into 100 pieces (outside the user will have appearance of 100 small images as a single large image) , and upon clicking each smaller image (ie any one of 100) , each image should be highlighted and shown as a separate image .
What is the best technique to do this ???

If that is ASP.Net app, then best idea would be to provide the image to web client and in javascript get info about [x,y] position of the mouse cursor on image, from there, computing rectangle, based on the way you want to split the image into sub-images and returning back the sub image , that contains given [x,y] position of the mouse cursor and displaying it.
Should be possible to do all in javascript, moving 100+1 images between client and server could be slow or getting the correct one as the mouse is moving, computation on the server, does not seem to be a good idea either.

Related

Cropping an image out from the background context [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have shape like the following image
, I need to crop the shape out from the background context in Javascript. The shape data is in the format of base64. I need to somehow read the image in a binary format but I am not how to do this in Javascript?
You can use OpenCV.js to read the data. What you are trying to do is called Background Substraction.
There is even a specific tutorial (OpenCV - Background Substraction) for what you are trying to accomplish.
In a nutshell, (1) you read the data, (2) you create a mask with what you are trying to delete, and then you use the data and the mask to create a new output.
The mask is nothing more than another image. One where white means keeping a pixel, and black means deleting it.

scrolling into z axis with css or javascript with image layered one by one [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
There are four images on a page in the same place. Only the top image is visible. The 3 images beneath it is not visible.
If the user scroll into the image, they will see the second image and first image will go out of screen. The animation will be like first image will getting bigger towards the four corner of the screen and eventually fade away.
User will get the feeling of moving towards Z axis to see the second image beneath first image. This animation will continue till last image.
All these image will point to different links. User can click on the image link or scroll.
Is css 3d transform the only option or any javascript plugin to assist this goal?
Example:
https://www.format.com/2016?ref=webdesignernews.com#
I'm not going to write an entire 3d CSS project for you, but here is how it can be done. http://eng.wealthfront.com/2012/03/22/scrolling-z-axis-with-css-3d-transforms/

Is it possible to save the location of a symbol that is moving on a polyline? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
So I am working on this project: So, I have that path symbols moving on a polyline, and as you know I want to simulate the speed of the real plane movement, and the plane needs to travel a lot of km so it takes a lot of time. So my question is if it is possible to save the movement of the plane so when i close my browser and open it again it remains at the same place where it was the last time I saw it or if it is possible for the plane to keep moving so it doesn't come back to the beginning when I open the browser again.
Thx a lot any help will be very appreciated!!
Well, if you want to know the position of the plane even if you close and reopen the browser, that means you need to store it on the backend. So, when you load the page, you retrieve the position of each plane from a database and then you draw them in the right position. After that you poll ever X seconds to redraw them in the updated position.
That means the movement algorithm that updates the position of each plane cannot depend on the frontend (client side), you need to do it on the backend.
Another idea, if you know the departure, arrival and current time, you can calculate the position of the plane and then draw it. And recalculate the position on client-side every X seconds to update the plane position. The departure and arrival times should be stored on a database in the backend/server-side. The current time should be retrieved from the backend/server-side as well since you cannot rely on the client's current time.

Create Buttons from image in HTML [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've got this interesting challenge here that I don't know how to solve. I'm trying to create HTML buttons from an Image. This image here is the example I am using. How can I split up all the trapezoids into separate buttons that register separately when tapped on the corresponding regions. I would assume I need to specify some kind of boundary for each trapezoid but I don't know how you would do that for a decently complex shape like this.
Use the HTML <map> element to create an image map from the image. Image maps allow you to map out shapes (circles, rectangles and irregular polygonal) from coordinates you provide and these shapes become clickable with their own hrefs. You are also able to get the x,y coordinates during the click event.
There are a variety of free tools on the Internet to generate the coordinates and the overall code.

Drawing an image in html5 using javascript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
i currently want to implement a draw image tool to my projects(something like the brush tool but instead of a color i am actually drawing with the picture). I want to be able to "draw" a picture by hovering my mouse over it. I m currently thinking about two possibilities, one is with a mask over the picture and actually erasing the mask with the mouse or the other posibility to try to draw with the canvas, making the zones touched by the mouse visible.
Do you have some general ideas about how should i start my work?
Thanks
I would prefer the canvas approach.
Here is another great tutorial:
https://code.tutsplus.com/tutorials/how-to-create-a-web-based-drawing-application-using-canvas--net-14288

Categories

Resources