Quickitem in qml image is blured when image is sacled - qt

I place a quickitem component in qml Image and draw some polygons with a pen of 0 line-width when I scale the image with the mouse wheel, the polygon looks blurred, how can the polygon look the same as they do(0 line-width graphicsitem should look very thin?) in QGraphicsView?
what can I do to make the 0 line-width polygon looks like the 0 line-width polygons in QGraphicsView?

Related

How to make translucent and ungeometrically shaped window in javafx?

Can somebody tell me how I can make translucent and ungeometrically shaped (any custom shape except geometric shapes like rectangle for ex- cloud shaped window) window in java fx. I tried it by setting the png image to the background of AnchorPane using css, but the whole AnchorPane is showing rectangular.

How to move colored points from 2D image to 3D sphere

I have 2D color image. All colored points are located inside round area in center of this rectangle image, all points outside circle are black (I get these rectangle images from fisheye camera).
I know the coordinates of center of this circle and its radius.
I need to move all colored points from circle area on 2D image to the surface of sphere. More precisely hemisphere, because my camera has 180 degrees FOV.
My question is. How to move these colored points correctly? Will it be correct to just assign Z coordinate to all points inside circle area in accordance with sphere equation?
To make my question more clear I attached 2D image from my fisheye camera and image with desirable result.
First, you need the lens calibration data of your camera. Ocam or opencv will do a great job for you.
Second, as you mentioned that you already know your optical center, you can convert image coordinate into the sphere coordinate. So, now you have mapping function that maps image coordinate to sphere coordinate.
Third, you need some sort of rendering tool to observe your image mapped sphere. The simplest way is to use OpenGL. Map your texture on a sphere and move the camera inside the sphere.

Is there an inverse to the CSS "Clip" property; hide the clipped area?

The CSS clip syntax gets you to define a rectangular area of a larger image that you wish to be visible. Is there a way to specify the inverse? Specify the rectangular area of the image that you wish to become invisible. Like punching a rectangular hole through the page to see what's underneath?
Reason (if you have any other ideas): I want to create a 3 layer image in a CMS template. Layer 1 (at the bottom) is a background image. Layer 2 sits over a portion of layer 1 and is a rectangular screengrab image of an A4 document. Layer 3 (on the top) is a transparent PNG (in its centre and at its edges) that adds a border, drop shadow, doc type logo and a page curl effect to the top right of the layer 2 document.
Layers 1 and 2 will be uploaded separately in the CMS and the CSS should combine them together with the layer 3 image to create the effect. The problem is for the page curl effect to work, the top right corner of layer 2 needs to be masked so that you can see all the way through from layer 3 to layer 1. I was hoping that the clip property would allow me to specify a small square in the top right corner of layer 2 that should be invisible.
Alternative: Is to use a graphics program to combine layers 1 and 3 together and leave a transparent area for layer 2. Then with the correct positioning you could place the new combined image on top of layer 2 to achieve the same effect. However, I was hoping to avoid graphics preparation like this because you may as well create the entire image that way.
Simple Answer:
CSS clip will not work for that.
I see two options:
Try to fake the 'hole' by drawing Layer3 with Layer1 as a background image. This will make the transparent areas of Layer3 be filled with Layer1. You can see this solution in action here: http://cssfilter.saschaseewald.com/
Use the HMTL Canvas Element and its composite actions to combine the layers as you like. Overview: http://www.html5canvastutorials.com/advanced/html5-canvas-global-composite-operations-tutorial/

QGraphicsItem: overlapping bounding rectangles when drawing polygons

I'm trying to draw a hexagonal lattice in Qt, in which each hexagon needs to be clickable. I've subclassed QGraphicsItem and am drawing the lattice fine using a for loop. The problem is that because the bounding rectangles for adjacent hexagons overlap, half the time the wrong hexagon gets clicked.
Is there any way around this? Which QGraphicsItem, QGraphicsScene, or QGraphicsView method would I need to re-implement?
QGraphicsItem::shape()

Using QGraphicsView to display a local map

I'm trying to use QGraphicsView in order to display a map image and draw some items on top of it. The map boundaries are in a Cartesian coordinate system, for example NE(-500,200) to SW(600,-350). I know how to map image pixels <--> my coordinate system.
I would have to achieve the following:
Add a map image to the scene and tell Qt how to map the actual image pixels to scene coordinates.
Add graphic items at their real position, e.g. (-100,200)
Doing (2) is straightforward - simply add the item to the scene. How do I achieve (1)? what should I do after I call scene->addPixmap()?
Edit - A few clarifications:
I'm mapping an indoor area of a few hundred meters
The map will change at real-time in two ways:
The map gets bigger every few seconds
The graphic items move, change colors, etc.
Put the pixmap into a QGraphicsPixmapItem and place it in the scene.
Call setScale() to map the QGraphicsPixmapItem so 1 meter maps to 1 unit in the scene coordinate. ie. setScale(0.1) if 10 pixels in the pixmap equal 1 meter.
Update the pixmap and scale of the item as needed.
Call fitInView() to zoom to the pixmap.
Place other graphic items in the scene. Treat the units of the scene coordinate as meters.
...
Profit! :)

Resources