How to delete selected area? - fabricjs

I'm working with fabricjs and am trying to create something like Paint, so I can open an image and edit it.
I would like to be able to select an area on this img, and delete it (-> fill it with white color), how can I have a visible selected area, get its coordinates, and fill it with white?

Related

How to change POI icons in Skobbler

Is it possible to change the map POI icons with a custom image or logo? I tried from StyleEditor, but i could change only the color of the selected POI.
You can change the color and texture of that selected POI category
e.g: in the StyleEditor, select "restaurant” from the map and change its color to red->all restaurant POIs will be red.
Each POI has a unique texture ID associated to it (found in the "TexID" text box)
e.g: out-of-the box the restaurant POI has texture id 1020 associated to it
Changing the ID to another texture ID: insert the new ID (see Features window at zoom levels 17-18) in the "TexID" text box (make sure that you choose "All Levels" before making the change so that the texture changes is applied at all zoom levels).
To add a new a new texture: first, make sure the image you want to add is in PNG format, colour space RGB, and the image resolution is 512x512 px.
copy the image in StyleEditor/MapResources/Common folder or in the Style's folder (e.g: StyleEditor/DayStyle folder if you are modifying the Daystyle)
add the texture in the StyleEditor from the Dialogs menu -> “Add Textures” option
browse for the desired image, in the "Add Textures" dialog box, by pressing the + button
give it an ID (make sure its unique) by entering it in the TextureID input box
click Add & OK buttons to finish adding up the new texture
Make sure to save your style

fabric.js object selection mouse down

I want to know if there is a way to select correct object when we click on it to change the color.
I have two angular triangles on my canvas but when i click on it i can only select one because the bounding box is squared.
I use :
canvas.on('mouse:down', function(e))
But i am unable to select the triangle i want only 1 is selectable due to the size of bounding box.
Thank you for your help
I want to change the color of the triangle when i click on it. Example if i click on the red triangle this triangle come green. If i click on the black triangle this one comes blue. But its impossible at this time.
You can try something like this:
canvas.on('mouse:down', function(e){
var triangle = e.target;
if(triangle)
triangle.setFill('your color');
});
You can add
perPixelTargetFind: true // prevents clicking on bounding-box around shape from selecting it
to the triangles

I would like to align/centre a image within a cell in excel

I would like to align/centre a image within a cell in excel.
When I insert the image into a cell it goes to the top left of the cell. I can manually drag the image to the centre however this is very time consuming as I have multiple cells of various sizes. Dragging the cell by the bottom corner is not an option.(see image 2)
Here's how to achive this, provided that the image is stored in a file:
Insert the image from an existing file
Snap the borders of the image to the borders of the cell by holding down the ALT-key and dragging the image borders using the mouse (forget about the aspect ratio for just a second)
Right-click the image, select "Change Picture..." and re-select the image file
Every time you change the size of the cell, use "Change Picture" again to repair the aspect ratio.
Simply join the cells together and put the image inside them.
To do this, select the cells that you want and put Arrange All, then the cells will be together and you can put the image inside them.

Motif: How to move Scroll Bar automatically without user intervention

I have a scrolled window in my application, in which I have created a drawing area widget. In the drawing area, I have placed multiple images. When the user enters information about an image in a search box, the appropriate image gets highlighted.
My problem is how do I get the application to scroll automatically to the highlighted Image box without the user using the scroll bar. The scrolledwindow should automatically move the view region, to display the region where the highlighted Image is present.
The scrolling policy used on the scrolled window is XmAUTOMATIC.
Any pointers would be greatly appreciated.Thanks in advance.
Try XmScrollVisible() if this does not work then you will need to:
1. Find out the size of the work area.
2. Find out the size and position of the clip window.
3. Find out the max/ min values for the horizontal scrollbar.
4. Use XmScrollBarGetValues() for the horizontal scrollbar to get its position within the max/min values.
5. Do some math magic to determine how much to move the horizontal scrollbar to get the work area to show through the clip window.
6. Call XmScrollBarSetValues() with Notify = True.
7. Repeat for the Vertical scrollbar.
HTH

How do I change the drawing setting to show the objects filled?

When I create drawing shapes I cant see any color or fill. I know there is a setting that need to be changed so I can see them. Here is a pick of what is happening on my screen:
I draw the shape and all I see is the green outline, any suggestions?
At the bottom of the screen on your timeline there is a green square on your layer, from the looks of it you have click that. This shows layers as outlines.

Resources