React: Select body part from image - reactjs

I want to build a website with React on which you can select different parts of a body. I would like to ask for your opinion what would be the best possibility for that? How can I highlight different parts of the body and make them clickable?
I would image a screen like this where I can press e.g. an arm, leg, head etc.:
Thank you for your help!

You will need two images.
Original colour body shape ( let's call this passive state ).
Active colour body shape.
Create a grid of rectangles on top of passive state image according to body parts, slice the active body shape image and put in rectangles as background images and set the image size to 0. On hover just set the size of the image to the original value.

Related

Inverted react-beautiful-dnd order

I have a working vertical column drag and drop React app using react-beautiful-dnd, but would like to 'invert' it so that Draggable items fall to the bottom of the Droppable div instead of floating to the top. Is this possible?
If I'm understanding you correctly, you'd like to have a list where when the container is not full, the items within that list are aligned to the bottom of the container?
If so, then yes - I would utilize flexbox.
Here is a good resource for flex - https://css-tricks.com/snippets/css/a-guide-to-flexbox/
There are multiple different ways to implement this with flex. Pick your poison.
edit
Based on the code sandbox:
I would add a wrapper div to the bay component with the same height as what you have now. On the child div, add a dynamic height field that is dependent on how many tables the bay contains.
Users won't be able to drop into the entire column but you could style it to show the user where they need to drop when the column is empty.
I ended up just creating another invisible strip with flexGrow = 1 to push everything to the bottom.

Clickable Maps In Container

I have an Image (map of Africa). I want each countries to be clickable such that a new form is opened on tap. Is this possible with CN1?
I have checked the cn1libs portal and can't find any library that does this.
I thank you
Create two maps. One would look like you want the map to look on the screen. The other would use a different color for every country.
Use a pointer listener or pointerReleased on a focusable component to track user taps on the map so you'd have an X/Y coordinate.
Use getRGB() to get the RGB colors of the pixels in the color map, then get the color at rgb[x + y * imageWidth]
This color represents the country that was picked and you can map to that using a switch statement.

Codename One: How to increase height of dialog

I have developed app using Codename one.I want to set specific height of dialog because my text overidden while displaying message in dialog body .what should I do for that?
Thanks in Advance?
I have added image in which first image is original image and second one is cut image which is displaying on screen while using infinite progress bar. my code is "Dialog ipDialog = new InfiniteProgress().showInifiniteBlocking(); ipDialog.Dispose()" I want whole image on screen like original image.
can you help me to solved this ?
You can use the Dialog show method that accepts int values to determine the distance from the edges. But normally this is a matter of the text sizing and dialog construction.
Also make sure you are showing the Dialog from the EDT thread.

Make list image bigger in Dynamics Nav 2013

I would like to make image bigger on an item list in Dynamics Nav 2013. What I could do so far is fetch the image and display it on the list.
To achieve this I call SearchImage function on OnAfterGetRecord :
OnAfterGetRecord()
SearchImage;
SearchImage function :
// C/AL Code
SearchImage()
//MESSAGE('1');
IF xRec."No."<>"No." THEN BEGIN
//MESSAGE('1');
CLEAR(TmpImg_gInit);
TmpImg_gInit.INIT;
//CurrPage.PictBox2.PAGE.SetRec(TmpImg_gInit);
//CurrPage.PictBox3.PAGE.SetRec(TmpImg_gInit);
i := 1;
//MESSAGE(FORMAT(TIME));
TmpImg_gInit.INIT;
TmpImg_gInit.RESET;
TmpImg_gInit.SETCURRENTKEY("Table ID","Document Type","No.","Line No.","Version No.","Picture No.");
TmpImg_gInit.SETRANGE("Table ID",27);
TmpImg_gInit.SETRANGE("Document Type",0);
TmpImg_gInit.SETRANGE("No.","No.");
//TmpImg_g.SETAUTOCALCFIELDS(Picture);
IF TmpImg_gInit.FINDFIRST THEN BEGIN
TmpImg_gInit.CALCFIELDS(Picture);
END;
//MESSAGE(FORMAT(TIME));
REPEAT
TmpImg_gInit.CALCFIELDS(Picture);
i:= i+1;
xRec."No.":="No.";
UNTIL TmpImg_gInit.NEXT = 0;
// CUDiv.SendKey('{F5}');
END;
Then in my list I can add a new field that point to TmpImg_gInit.Picture and this will display the item's image.
The thing is the displayed image is tiny (whereas the source image is big). The image is automatically resized to fit in the list height.
I would like to know how I could display this image bigger. Is there a way to do that easily (without add-ins) ? If not can you give me directions on how to do that ?
You can use a FactBox which will display a larger image on the right hand side of the screen.
However, it will only show the picture of the item that you've selected. For things like product images, this is optimal. E.g. loading lots of hi-res product images can put strain on the users PC.
The image size when inline on a page cannot be changed and are better suited to things like Status icons, e.g. traffic lights.
Custom Control Add-ins
NAV does support modification of the page UI through Control Add-ins. You'll need to create a test project/control that is an image and see whether it will let you expand the height above the set row height.
You can get more information on sizing of Control Add-ins on MSDN.

Navigate through big image

I have a big image with coordinate points.
I need to navigate through these points by pressing onscreen buttons.
Only a part of image is seen on the screen at once (shows your location).
By pressing arrow button the view moves to the next part of the same image.
This example looks good.
Please, suggest any way to implement this functionality in Codename One App
Thank You.
You can use the Map component but you can place any image as a label icon within a scrollable container and just let the user use the touch/keys to scroll.

Resources