This question already has answers here:
Draw lines between points(multiple)
(2 answers)
Closed 8 years ago.
Can someone show me an example on how to plot points and connect them in iOS objective C. Do I need to put CGPoint's in an array or can we draw one point at a time? What we want to do is calculate the corresponding y value from x value and make a CGPoint and plot them, in a for loop.
Thank you
It's not really about what language you are using, it's about what technology stack you are using. iOS? Mac? Then there are many options: 3rd party library, Core Plot, Core Graphics (2D procedural drawing API), Open GL, Core Animation (2D/3D compositing and animation API) or even some combination of these.
The correct answer depends on what you are building, big picture.
As it stands I think the question is to broad to answer.
Related
This question already has answers here:
Detect when a Mac OS X window is resized or moved
(5 answers)
Closed 1 year ago.
I’ve got an objective C sprite kit game that works fine in a standard window size, however when the game window is resized to full screen, the main character sprite needs to have its y axis changed. In order to implement this, I need to check if the window has been resized in the game loop. how do I go about doing this?
You can use NSWindowDelagate. The NSWindowDelegate protocol has windowWillResize:toSize: and windowWillMove: methods.
This question already has an answer here:
iOS CoreImage Edge detection
(1 answer)
Closed 9 years ago.
Here is the UIImage, Wikipedia icon,
But it is a png file, but I would like to find the boundary of this image like this(Sorry, ugly drawing):
Is there any existing algorithm that allow me to find out the image?
Here is the assumption:
1. All the background is transparent.
2. The image MUST be one big piece.
Thanks.
Are you looking for this. I didn't tried this myself but it will solve your problem seems. Here's the tutorial.
UIImage* edge = [myImage edgeDetectionWithBias:0];
I am not sure, if it will solve your problem.
This question already has an answer here:
Is it possible? camera api ios [closed]
(1 answer)
Closed 9 years ago.
I was wondering if its possible to show a layer (UIImageView?) on top of the camera view while taking a picture. I know its easy to implement a layer after the photo is taken but I want to show that layer while taking the picture. Think of it like a frame for your picture.
I've never seen an app that has done this before so I was wondering if it's even possible.
The term you are looking for is an overlay
Here's Apple's sample code.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Specify images for iPad in Xcode like #2x for iPhone 4
I'm having trouble finding current conclusive information about how to properly use images based on device classes (Apple documentation being like a maze of twisted corridors, all alike). My sense is that this is something that has evolved a bit over time. Suppose I want to support non-retina and retina iphones and ipads with different images.
Here are all the permutations of filenames that I can think of:
image.png
image#2x.png
image~iphone.png
image~ipad.png
image#2x~iphone.png
image#2x~ipad.png
I could do this:
myview.xib
myview~ipad.xib
Suppose I have four devices, iPhone 3GS, iPhone 4, iPad 2, iPad 3 (or 'new iPad' for purists).
Let's talk about how I would set up my xibs (i.e. I add a UIImageView, what do I choose for an image?) to use the appropriate image and how, if I use code, [UIImage imageNamed:#"image"] would behave.
It's my understanding that in code I could fall back on UI_USER_INTERFACE_IDIOM() but I'm not convinced that I need to.
If someone could explain what will and won't work, I know that it'll be a help to me, and I suspect to others. If I've somehow duplicated another SO question I couldn't find, well, we can close this up and link to it. Thanks!
in iphone xib you have to use image~iphone. on ipad xib you have to use image~ipad. #2x is automatic selected when file is needed.
I want to make a game where I need a square shaped matrix with 6 row and six columns.
How to do that?
Here is an iPhone compatible version of Apple's Geek Game Board sample code:
https://bitbucket.org/snej/geekgameboard/.
The original version can be found here (Mac only):
http://developer.apple.com/library/mac/#samplecode/GeekGameBoard/Introduction/Intro.html
It's using Core Animation and provides reusable classes for your problem.