How to draw a drop shadow AND gradient with quartz2d? - iphone

I've a custom shape drawing using coregraphics and i want to add a drop shadow and a gradient to it also. I've been trying and searching a lot of informations on how to combine and do this, but i can't get it to work. I'm able to draw only one either.
Anyone doing this already or know how to do this? Thank you.

Quartz only applies shadows to fills and strokes. Drawing a gradient does not count as a fill.
Fill with a solid color (to draw the shadow), then draw the gradient in the same area.

Related

How to draw custom shapes in flutter

I'm trying to draw a custom shape like this in my app:
Tried to draw using custom painter, but haven't figured out how to get this sort of shape. It's really just a container with a custom border I think, but not sure even where to start. It's just the shape I'm interested in, not the content.
Or if someone knows how to draw a rounded rectangle with a thinner bottom section, then that would really help me to work out the rest.
Also, does anyone here know how to draw a rounded rectangle that is thinner in the middle, like the shape behind the purple one in the example I've given?
Any help is grately appreciated.
Thanks in advance
use this tools
this is the link
download it for your windows and draw your shape and generate the code..
here is the tutorial on how to use the tools
the tutorial on how to use it

core plot areafill with this kind?

Are there any solution for this kind of fill for the core plot ? I konw that it can be filled with the color, an image .but when fill with the image ,It will be cover the xAxis majorGridLineStyle.Can anybody tell have the better solution,
Thanks
Use a tiled image. If you need the gradient in the background, use a tall strip that can tile horizontally to make the stripes. If you don't care about the gradient, a small patch that includes both stripe colors will suffice.

Iphone Set background image into text in uitextView?/

I have a uiimageView containing the text like this.
I want to set the image background of the text to look like this instead.
Please help me! Thanks!
You will need to combine an image of the text with the background image (the stuff that is supposed to fill the inside of the text) using compositing. Take a look at the various blend modes you can use, or look into the use of CIFilter.
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CGContext/Reference/reference.html#//apple_ref/doc/c_ref/CGBlendMode
https://developer.apple.com/library/mac/#documentation/graphicsimaging/Reference/CoreImageFilterReference/Reference/reference.html
The thing in the background looks like it might be a gradient. Again, you can use a CIFilter to generate that gradient, or you can use Core Graphics. So you'll composite the drawn text with its fill image, then you'll draw that over a gradient.
instead of text in black solid color, make image with transparent text and outer region as the grey gradient you want and put this image over you background image, you will get the desired result.

How to draw custom line on MKMapview?

I've been searching for a way to draw a custom line, but the only help I can find is how to draw lines with an UIColor.
I want to draw a straight line but not just with a color. I want the appearance of the line to be customizable.
(So right now I can draw lines between 2 points, but not the line I want)
The line I want got straight 45 degree lines on it, and it's grey and black.
Anybody can help?
The line looks like this, I'm also thinking that I could stretch this image, but if I stretch it, it will look kinda weird.
Why don't you add image then? I'm new developer so I don't know other way to do it. Only OpenGL with texturing, but there is no need to use openGL. So my suggestion is to add image.
Sound like what your looking for is the MKPolylineView Class. You assign it a polyline which contains the points in your line. Since the polyline view is an MKOverlayPathView you can set the stroke and fill colors.
Since it's also a UIView subclass you can manipulate the appearance even further by grabing the views layer property and adding gradients, shadows, masks, etc.
Is there a specific effect that you're trying to achieve?

How to change polygon shape in CAShapeLayer by tapping its corners?

I am drawing a CAShapeLayer with a polygon with 8 corners. I want to change the shape of the polygon by dragging one or multiple corners at a time. How can i achieve this?
CHeers
AF
Unfortunately i have not got a solution for this yet. I kept trying different things but the only thing that slightly worked for me, which is not optimal, is to apply the transformation of the corners as multiple animations applied on the path.