Move Images in the same axis Xcode-IOS - ios

I'm trying to move an image on the same axis,according to data obtained by the device I want the image to move up or down while keeping the center on the Y axis. Thanks.

I used this and it worked:
imattitude.transform = CGAffineTransformTranslate(imattitude.transform, 0, accel[2]*75);
Where 0 is the value in x axis to move and accel[2]*75 is the value in axis y for move.

Here is a tutorial to help you:
http://www.codeproject.com/Articles/93563/Introduction-to-iOS-Graphics-APIs-Part-1
The big change is:
CGContextMoveToPoint(context,fromPoint.x , fromPoint.y);
Do not change both, only change one, and used a fixed Y.
CGContextMoveToPoint(context,fromPoint.x , 160);

Related

iOS Charts - Equidistant Y Values?

For the iOS Charts library, does anybody know how to make the y axis values equidistant from one another? So in the following picture the "1" line would be halfway up the graph?
Set axisMinimum to zero will result in your desired output.
//chartView is the object of BarChartView class.
let yAxisLeft : YAxis = self.chartView.leftAxis
yAxisLeft.axisMinimum = 0
It will remain consistent for other values too.

Centered axis using ShinobiCharts (iOS)

I followed the Quick Start tutorial about Shinobicharts, and I'm wondering how to get a centered graph like this one
cos graph
I succeded to center the x axis using this :
chart.xAxis.axisPositionValue = #0;
How can I center the y axis as well? Thanks in advance!
DISCLAIMER: I am a developer at Shinobi Controls.
The "axisPositionValue" is in data terms on the other axis.
For example, if you had a X-axis with the data range 0 - 10 and a Y-axis with the data range 0 - 100. To get both axes to be in the centre of the chart set the X-axis' "axisPositionValue" & the Y-axis' "axisPositionValue" to 5 like so:
chart.xAxis.axisPositionValue = #50;
chart.yAxis.axisPositionValue = #5;
Let me know if you have any questions.

TChart in C++Builder 6.0 rotate chart

Can I rotate a chart? I need x on vertical axis and y on horizontal axis.
Can I change x value to vertical axis and y value to horizontal axis?
Or can I rotate of the component TChart (xy values stay standard and I flip component 90)?
Thank you.
The easiest solution would probably be to use swap your values or add your X values as YValues and add your y values as XValues.
Ie, let's say you have your X values in an array called Xdata and your Y values in an array called Ydata. You could add your values with this:
Series1->AddXY(Ydata, Xdata);
Maybe I can write - i used a line(fast line) chart.
There
[IMG]http://i68.tinypic.com/29atrw5.png[/IMG]
is Classical graph and image if I rotate it. If I change x-y values as You wrote I get wrong image.
y = f(x) so it paint for x=1, x=2, ... but i need paint x = f(y) for y=1, y=2, y=3
I need something as is point chart - connect handly in paint
I'm not sure if it is possible change axis or rotate component teeChart.
I probably use TImage and will paint it into image.
today i find that teechart have a series "horiz line" (https://www.steema.com/files/public/teechart/java/v1/docs/Tutorials/tutorial1.htm).
But licence is expensive for our company (https://www.steema.com/buy). We need only one chart with this axes.
Do you know if can I install only some update into BCB 6?

Convert Scene's (x, y) to screen's (x, y)

I have an application built with SceneKit that is currently displaying several nodes. I can figure out which node is pressed and want to use that to make a label appear below the Node that was touched. Now, when I set the label's center the following way...
nameLabel.center = CGPointMake(CGFloat(result.node.position.x), CGFloat(result.node.position.y+20)
…it appears in the upper left corner since the node is on (1, 0). What I figured is that the sceneView's (0, 0) is in the center of the screen while the actual physical display's (0, 0) is in the top left corner.
Is there a way to convert the two different numbers into each other? (I could hardcode since I know where the Node's are or create a separate label for each Node but that is not really a perfect solution.)
Thanks in advance :)
You can use the projectPoint: method:
var projected = view.projectPoint(result.node.position))
//projected is an SCNVector3
//projected.x and y are the node's position in screen coordinates
//projected.z is its depth relative to the near and far clipping planes
nameLabel.center = CGPointMake(CGFloat(projected.x), CGFloat(projected.y+20)

How to draw an effect (Gloss with metallic lustre) on concentric circle such as following?

I referred to following article. What I actually need to draw is concentric/ Concrete circles with an effect as shown in image below.
I am finding it difficult to a) Draw the white streaks radially b) Find some key terms to search for related articles to proceed further on this.
Any hint or link to read about this will be of great help.
Try these
Metallic Knob
Metallic Knob 2
http://maniacdev.com/2012/06/ios-source-code-example-making-reflective-metallic-buttons-like-the-music-app
This is a tutorial on making reflective metal buttons. You can apply the techniques from the source code to whatever object you're trying to make. The source code is found here on github. I just googled "ios objective c metal effect" because that's what you're trying to do, right? The metal effect appears in concentric circles and changes as you tilt your phone, just as the iOS6 music slider does.
I don't have any code for you but the idea is actually quite simple. You're drawing a number of lines radiating from a single, central point (say 50,50) to four different sets of points. First set is for x = 0 to 100, y = 0. Second set is for y = 0 to 100, x = 0. Third set is for x = 0 to 100, y = 100. Fourth set is for y = 0 to 100, x = 100. And for each step you need to either change the colour from white to black or white to grey in increments or use a look up table with your colour values in it.

Resources