I am trying to capture an Image from Camera show it on the UIImageView.
After that I have some buttons for e.g. "Paint Brush", "Eraser", "Undo", "Save".
Using Brush I want to mark some items on the image captured.
What is the best way to accomplish the annotation and then save the image.
I am not sure what should be used. Should I use touchesbegan/end etc.. or some other alternative.
Regards,
Nirav
U need to understand Bézier Path Basics.Search it on Google or Apple Documentation.
The UIBezierPath class is an Objective-C wrapper for the path-related features in the Core Graphics framework. You can use this class to define simple shapes, such as ovals and rectangles, as well as complex shapes that incorporate multiple straight and curved line segments.
Related
Using Apple's own photo album, when editing photos, I used the Apple Pencil to draw blurred red paths, keeping and then creating perfect circles.
I looked at the API for PencilKit and found that Apple does not provide one. But I want to implement drawing in my application and keep creating the perfect shape. How do I do that?
Shape recognition is a private API. Only Apple's app can use it. My suggestion would be: Check last stroke in the canvasViewDrawingDidChange(), then check with your algorithmen which shape it is, then create a beautiful PKStroke and replace the last stroke.
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.
I want to give a effect for UILabel text that will look exactly same like we are writing on a paper using pen. I searched for it but not getting any related suggestion/solutions, there are solutions like typing effect but not as I need.
The only way to accomplish this is to manually draw the stroked for the inserted letters via a graphics API (Core Graphics, OpenGL, etc.). You cannot accomplish this without manual drawing. It is possible that there's a 3rd party library that can help you with this. You can use a tool like PaintCode to extract the bezier paths and what not to help you manually drag glyphs for each letter in an alphabet and then animate those paths using Core Animation or another graphical drawing mechanism.
I have a GameViewController with some different subviews representing game object, such as scores, players, history, etc...
The user can drag around custom shapes on the GameBoard (CAShapeLayer).
I want to add a blur to the custom shapes. However, to first blur the background with all the game elements and then mask the image to the custom shape is horrible slow.
Is this possible to do with good performance, and how would you do it in that case?
Thanks
You should use GPUImage library if you are concerned about performance. https://github.com/BradLarson/GPUImage
This tutorial will guide you completely about how to use the blur functionality you need:
http://www.raywenderlich.com/60968/ios-7-blur-effects-gpuimage
I am developing an iPhone application that uses Cocos3d to draw shapes and images. Now I want to draw some text. Can anyone please guide me on how to draw text using Cocos3d?
Thanks in advance!
If you want to embed text in the 3D scene (like add a sign on a wall within the 3D scene), you can use CC3BitmapLabelNode. The CC3DemoMashUp app includes an example of how to do this, in the addBitmapLabel method of CC3DemoMashUpScene. The example actually does more than you need, because it uses a specialized subclass of CC3BitmapLabelNode that wraps the text around a cylinder. But it will give you the idea of how to use CC3BitmapLabelNode.
If you want to add text as a 2D overlay as part of the user interface (like a button, menu, or message to the user), use the standard Cocos2D components for that. You can add these 2D components to your customized CC3Layer. See the CC3DemoMashUpLayer for an example of how to do this.