How do I draw concurrent custom shapes in flutter like this? - flutter

I want to create the shapes which are at the bottom of the design, but I'm unable to think of an approach I tried transform.rotate on a container but there are overflow issues. Any kind of help is appreciated. Thanks!
Here's the link to the design, that I want to create.

There are a few solutions for this UI:
You can export the background as an image.
Pros: Save time, easy.
Cons: Performance is not good as solution 2 below (for loading image and app size).
Use canvas (and paint) to draw those curves. If you're not familiar with Canvas in Flutter, you can check this tutorial.
Pros: performance is better (render time is faster and app size is smaller).
Cons: time consuming, sometimes you will need to have good maths knowledge to draw complex UI.

I found a better option for creating custom shapes.
There is this website, which converts shapes to code.
Here's the link: https://fluttershapemaker.com
It saves a lot of time. Thanks.

Related

2D game development sprite/layout/terrain creation

ask a general question. There are few sprite resources and they are hardly liked by me. I would like to learn from the absolute scratch, such as how do I create a sprite from my idea.
Can I ask do I create it this way or what's the standard process?
1. draw it on white paper
2. scan it into a .png jpg etc
3. render it in photoshop
Thanks.
It's not quite right for Stack Overflow indeed, but I have a few suggestions anyway.
If you want to hand draw your art there are a few approaches. I started drawing the resources I needed on paper and scanning them, but this raises a couple of problems.
The first problem is that it can be hard to remove the white background properly leaving nasty bitty edges. This can be solved with time, practice and patience, and as far as I know there is no good way around this.
When using paper, it can be very hard to get clean areas of solid color. Pencils and the like leave and extremely distinctive paper texture, but approaches that give more solid colors using inks tend to go very blotchy.
The other problem is that if you want to animate these, or indeed reuse part of one sprite in another, you're left drawing bits of sprites - this lead me on to my currently favored methodology.
My recommendation would be to use ink onto acetate. You'll need to do some research into the best inks to use, but it means you can build the sprites in layers, much like animators used to do for film back in the day. You still have to solve the white background problem after scanning though, and if you pick the wrong ink it can be very easy to smudge your drawings - not ideal.
The other, more expensive alternative is to use a graphics tablet, and cut out the paper/acetate stage all together. This solves the white background problem, but some people find drawing with tablets oddly difficult - myself included.
Adobe software wise - I would personally use Illustrator while working with a graphics tablet, Photoshop for making adjustments to the resulting images, and Fireworks for building UI interface elements.
Hope this helps!
This is not really a coding question. As far as I know stackoverflow is only for technical problems. That said, I would recommend Illustrator to get started. There are some great tutorials out there. :)

How to use Core Graphics Layer Drawing

Can anyone tell me about how to color with pattern(Butterfly) like follwing link a link.
In addition to reading the entirety of the CGLayer reference you posted in your original question I strongly advise you to watch the 'Optimizing 2D Graphics and Animation Performance' session from the 2012 WWDC.
As you progress I think you'll find that it isn't particularly difficult to draw content to the screen using the likes of Quartz 2D and Core Animation but the real challenge will be doing so in a way that achieves an acceptable level of performance.
In the session they optimise a drawing app similar to the one you want to create. The fundamental principals they used to optimize their drawing app were:
Only ever update as little of the screen as you need to
Every so often create a flat composite image of what the user has drawn and re-use this image in proceeding drawing operations. This prevents having to draw everything the user has drawn to the canvas individually, making the application much more performant.
In addition to this they cover a collection of tricks to squeeze out every drop of performance.
I apologise that I have no code examples for you (I usually like my answers to include some) but your question was very broad. I suggest you watch the video I have suggested, continue your research and attempt to begin implementing the application yourself. Once you run into more specific problems you can return here for answers in the event you can't find them elsewhere.
Good luck!

Fake long exposure on iOS

I have to implement long exposure photo capabilities to an app. Since i know that this is not really possible i have to fake it. It should work like "Slow Shutter" or "Magic Shutter".
Sadly i got no clue how to achieve this. I know how to take images with the camera (through AVFoundation) but i'm stuck at merging them to fake long shutter times.
Possibly i need to manipulate and combine all the images with coregraphics but i'm not sure about this (even the how). Maybe there's a better solution to this.
I would appreciate every help i can get here,
thank you people!
You might try the plus lighter blend mode.
Well, I suppose it would be possible to average together the results of several shots. I've mucked around a bit with the core graphics stuff to resize images (averaging together adjacent pixels), but with lower res images. The algorithm I used is here -- maybe it'll give you some ideas.
There may, of course, be a better way, and some tricks for working efficiently with high-res images. Can't help you there.
Convert the images to pixel bitmaps. Align and stack the bitmaps. Then try applying various 3D convolution filters to the 3D pixel array.

How to draw an image according to the pixels of another image?

HI all ,what i want is to map the images.Suppose i have two images of persons,one is of fat person and another is of weak person,Now i want to match their faces ,eyes.I want to increase or decrease the face size eye size of one image according to another.As you can see in adobe photoshop you can make the face fat,make it squueze.I want to do the image manuplation in this.These types of operations i want to implement.I don't know from where to start.
Pleas guide and help me.Can i perform all this with core graphics if so then how
Any reference,tutorial address ,sample code ........appreciated.
You are probably going to have to deal with some sort of edge detection and face recognition algorithms, at the very least, if this is to be accomplished automatically. Otherwise, if the user is going to be resizing one image to match the other, this will require simple resizing operations driven by perhaps user pinch & gestures.
UPDATE:
For manual resizing:
Download the source code for the great book Cool iPhone Projects. One of the projects is called 'Touching'. This project contains code that accomplishes what you need: pinch and zoom functionality.

Need some guidelines on iPad animation programming

I'm creating an interactive e-book for the iPad. This book will contain multiple pages that will consist of a lot of animations (frame and motion animations), transitions,... I was wondering what my development options are, should I use OpenGL, Quartz,...?
I've use UIImageView.animationImages before and found that it had really bad performance. What's the best way to draw frame based animations?
Does anybody have some good pointers to resources on this?
thanks in advance,
Thomas
I guess that depends a bit on what you'll be drawing. If you have a need for 3D, then OpenGL is the way to go, but it doesn't sound like it. I have a feeling Quartz2D is going to be just fine for your 2D drawing needs. I've done drawing with both and they have a very similar API. I think the downside of using all the raw power of OpenGL is that you have then signed up for doing most of the work yourself. I don't recommend attempting to using Core Animation high level APIs to manipulate OpenGL views.
If you do use Quartz2D and "normal" UIViews instead of OpenGL/EAGLView, then you can take advantage the many pre-canned animations Apple already build with Core Animation. This include the card flip left/right, resizing, moving (x/y translation), rotation and the ever popular e-book page curl.
The best example of iBook like custom page curl functionality I could find is this example code from High Caffeine Content. However, you don't have to bring that much math to the table if you just want to use the out of the box Core Animation stuff. The bad performance you may have encountered could have been due to anything, including older/slower hardware. They have revved the graphics chips on the new devices.