Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Suppose I have array of points.I want to draw the route of that points in iphone. How it can be done. i dont get the appropriate answer till now . plz help me.
Assuming you have an array of CLLocationCoordinate2D called coords:
int size = sizeof(coords[0]) / sizeof(coords);
MKPolyline* line = [MKPolyline polylineWithCoordinates:coords count:size];
[mapView addOverlay:line];
Now i use Quartz to draw the path between that points.I take two points and draw line between that points and so on till the end of the array and it gives the route between starting point and end point.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am trying to find the CGColor at a CGPoint in a CGImage. There are multiple Stack Overflow posts that have something similar (like UIImage instead of CGImage or Objective C instead of Swift), but nothing specific enough to help me.
Does anyone know how to get the color at a point? Thanks.
Im assuming based on your macOS tag that you want to do this on macOS and thus can use NSImage and NSBitmapImageRep:
let cgImage = //your CGImage
let bitmap = NSBitmapImageRep(cgImage: cgImage)
if let colorAtPoint = bitmap.colorAt(x: 0, y: 0) {
let cgColor = colorAtPoint.cgColor
print(cgColor)
}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I can't really explane whats going on so here is the video:
I can't explain this
Something went wrong with the rotation axis? I don't know what cause it. I don't know how to fix it.
Its like someone messed something with the axis? I even don't know how to do that...
Please help me!
Don't worry, it's because you modify the value in Transform, in fact, the changed localPosition and localRotation are relative coordinate values; when this parameter is changed, it is relative to the parent node.
The objects we see in Scene are Position and Rotation, which are the values in world coordinates, which are the relative coordinates plus the parent node's value in world coordinates.
So all you need to do is reset the Transform of the GameObject's parent node to the initial value.
then the modification of the relative coordinates will be consistent with the world coordinates.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
I am getting x,y (cartesian) coordinates for a map from an API. I "draw" this map using polylines, it looks like this:
Problem is: due to the projection, the hallways in the south are a lot wider than in reality. I tried converting the coordinates to LatLng with LayerPointToLatLng, but no luck. How do I properly convert cartesian coordinates to LatLng so that the distortion is compensated? Thank you!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've a UIBezierPath drawing this
And I want the red point to move on the blue path infinitely (from right to left, from left to right)
How can I do that?
You can use CAKeyFrameAnimation. Assign your path to the path property of the animation object, then run the animation on the view's layer.
Edit:
A little snippet as a hint:
let path = ... // the UIBezierPath
let animation = CAKeyFrameAnimation()
animation.path = path.CGPath
animation.calculationMode = kCAAnimationPaced // This give the animation an even pace
animation.repeatCount = HUGE // This makes the animation repeat forever
viewToAnimation.layer.addAnimation(animation, forKey: nil)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a skeletonized binary image.
The image contains curved lines.
I want to be able to find the length of a line (number of pixels) between any two point (on the line of course).
How can I do it (in Matlab)?
Here is one approach for simple situations (where there are no loops etc, and your line is only a pixel wide)
Start at the startpoint, define as currentpoint and mark as visited
Go to an unvisited neighbor point of the currentpoint
Increase count by 1, mark as visited, define this point as currentpoint
If you reach the endpoint, stop. If you still have univisited neighbors, goto 2. If you run out of unvisited neighbors, reset count to zero and try walking from the startpoint (to explore the opposite direction).
Of course this can work in any programming language. Try to implement this in MATLAB and if you get stuck you can consider to ask a more specific question.