I was looking at websites like https://milanote.com/ and I am trying to implement image manipulation (functions such as dragging, resizing, cropping), and I noticed that they tend not to use HTML canvas. I've looked into react libraries that support drag and drop, but I have not found one supports image rescaling.
Any suggestions or idea to the best approach to this?
react-grid-layout is a complex grid layout system. You can set the image as a background of a grid element. There are a lot of possibilites.
Related
React newbie here.
I am looking for a way to add drag and drop functionality to my website. The goal is to move cards in a grid (I am currently using tailwind css to handle the grid). I found a few libraries that enable drag and drop but none that would:
work in a grid, i.e. in 2D
snap the cards to the grid
reorganize the cards when one is moved (to prevent overlapping)
I tried using react-beautiful-dnd but it seems to only be suitable for lists (i.e. 1D). I also tried react-dnd but I couldn't make it work either, I don't think it is meant to be used in a grid.
I found some libraries that do exactly what I want in angular (https://stackblitz.com/edit/angular-dragdrop-grid) and in vue (https://codesandbox.io/s/j4vn761455), but I can't seem to find react equivalents.
Would you know a react library I could use?
Thanks
To give you the context, I built a dashboard with a material-ui grid with 3 different sizes of widgets (small, medium and large).
The widgets are not drag and drop and to move the widgets you have to go to another page of the application which is not very UX design. I've never dragged and dropped with react and I'm wondering if there is an easy way to make my material-ui drag and drop grid. I would like to have some suggestions, examples if you have thank you in advance for your help.
For information I saw that there were several libraries (react-beautiful-dnd, dnd-kit)
Here is what I have tried with dnd-kit but I cannot make my grid easily drag and drop :
https://codesandbox.io/s/dndkit-material-ui-grid-sample-ck6l3?file=/src/App.js
I am new to GTK+3 and I want to create a custom drawing widget (maybe a grid). I need to be able to drag and drop logic objects on it for my logic gate simulator. How can this be done? The Drawing Area should be beside the menu containing logic objects.
I would probably recommend you use a GtkDrawingArea inside a GtkScrolledWindow. All drawing will have to be custom using Cairo. Draw a grid, then handle arranging your logic objects manually. You could use one of the GtkToolItem widgets for your top or side box of objects.
It's an ambitious project for the first time, but very similar to my first major project. It uses a very similar GtkDrawingArea idea. It's in Perl, and is here on GitHub. If you can decipher Perl, it might provide you some ideas for how a custom widget can be done.
In my opinion your requirements seem to be more tailored to a canvas. Project Ridley includes a selection of canvases candidate to be included in GTK+. Not sure this is still relevant now, but that selection is a good.
Is there any way to make Image Viewer swipe vertically? It would be great to have that functionality. If it's not implemented, is there any chance to achieve this overriding some method from the class?
Thanks
No.
The source assumes horizontal swipe quite heavily and this isn't trivial to change in a generic way as there is quite a lot of other code there to implement things such as pan and zoom.
You might be able to hack something manually that suits your needs based on our source. If you are able to come up with something generic and change the ImageViewer class feel free to submit a pull request.
I am Working on a WPF based project where the design team have created the design in blend with some images like Edit, delete, checkbox etc. where i am prefring to use xaml insteed of images
Although i am sure that if the images are prety complex they should be used as images. but the simple im icon images can be used as xaml path designs. So i am looking for the recomandations. When to use Images in WPF design and When to use xaml for design.
If your application is going to be used in different screen resolutions then using Vector Graphics is recommended as they will scale nicely and all your images will look sharp regardless of the resolution of the screen. (There is a downside as well because your application needs to do the extra rendering of the xaml images to display them)
If you are using the images just to display the toolbar images (which are pretty much small and fixed size then you can get away by using png files as they will take less resources and easy to manage)