I am upgrading open layers library from 2.13 to 3.7. I am able to draw rectangle or circle but not able to modify them. It is taking rectangle as polygon and when resizing, going out of boundaries.
For circle, couldn't find any option. Please help.
ol.interaction.Modify does not currently support ol.geom.Circle geometries. You would have to write your own interaction, or contribute to the ol3 project.
Related
I’m creating a drawing app similar to pigment on iOS.
I would like to know if there are any ideas on how to implement the drawing strokes within the limited boundaries like in the example image
I think the best approach I’ve tried is to create a clipped Bézier path and constrain drawing into that , but I’m stuck on how to generate a Bézier path from the white area I’ve selected
Can anyone explain how to do that or provide an alternative approach ?
Need to develop the component shown in the image above using Objective-C language. No idea where to start and which framework to use. Any heads up/reference links to develop this component is highly appreciated.
Use a combination of UIBezierPaths with custom fill colors. You can either use a shape layer or core graphics. Bezier path allows you to construct a custom path, so the first one will be a triangle, and the second a quadrilateral.
You could also use paint code if you want to construct the path visually.
Look at this
https://www.raywenderlich.com/76433/how-to-make-a-custom-control-swift
It's a very general way to create whatever control you want.
So what I want to do is build an image the size of the device. The image should be all blue except for a circle at coords (x,y) with a radius of z that should be clear, where x,y,z are variables. I know I should use the CGContext I just don't know how to get it done.
Ani ideas?
You want to use Core Graphics for this. To be more precise, read up on CGContext and the functions used to manipulate them. There are plenty of tutorials for it out there, and Apple provides a lot of sample code as well.
I am rendering an image using directx 11. The objective is to select pixels from this image and then move it around with mouse. The selection can be of any geometry, like bezier, rectangle etc.
I am new to directx, could someone please suggest a way to achieve this?
Thanks.
On iOS, I'm using core-plot to draw a line graph. I want the line to be bordered top and bottom with a solid color and a different color in the middle, a striping effect. This cannot be done using CPTLineStyle, so I created a custom line style that uses CGContextSetStrokePattern to draw the line.
I thought I achieve the desired effect by creating a striped image and using it as the stroke pattern. This works, but the image orientation does not follow the direction of the path. The stripes are always horizontal even if the direction of the path is 45 degrees.
How can I tell Quartz auto rotate the pattern fill such that it follows the vector direction of the graph segment? Or alternatively, how can I get core-plot to do this for me?
We recently added the lineGradient property to CPTLineStyle that gives you a very flexible way to do this. See the "Gradient Scatter Plot" demo in the Plot Gallery example app.
Note that this change was added after the 1.3 release and is not part of a downloadable release yet. You will need to pull the latest code with Mercurial to get the change or wait for the next release.
The best solution I've found is to use two plots. The first with the wider line style the second with the narrower one. That achieves the desired effect.