How to fit border the hero sprite - ios

How can i remove the white color in this picture?
[

If your image itself has white background, you should get an image with clear background. If you want the change the bg color of UIImageView you can do it in properties inspector in storyboard. thanks.

Related

Blurred or transparent bottom of image

I need to add some effect to background image that will blurring the image in the bottom. Like here on background image :
Does someone know how to do it ?
That's not actually blurred, it's fading out to white. You can achieve this by putting a vertical gradient over the top of the image that goes from 100% opaque (alpha 1.0) white at the bottom to 0% opaque (alpha 0.0) white at the top.
There's a decent gradients tutorial here:
http://blog.apoorvmote.com/gradient-background-uiview-ios-swift/
Create a UIView with required CGRect and then add your UIImageView as subview to the UIView. Now set some gradient color to UIView, this way you can achieve your requirement.

Transparent text color in a Today View Widget

I'm trying to get the same color/transparent effect as Apple has used on the bottom borders of table view cells in the today view. How can I also use this effect on for example a UILabel?
How do you get the white transparent effect on a UILabel in a today view widget?
I've wondered the same myself. I think They're setting a color of white with 0.4 alpha on the font and a color of black with 0.4 alpha on the background. They overlay the whole thing over a gaussian-blurred and saturated image of what was previously behind the today view.
So the required steps to produce the same effect would be something like the following:
1. Grab background image
2. Blur and saturate image
3. Add below the current view
4. Set black background of 0.4 alpha and white font of 0.4 alpha on the current view.
If you can think of a way to make the background translucent right behind the font that would make the color show more.
Here's an image of what that would look like (including the translucent background behind the text). I did this real quick in photoshop, don't mind the font.
Hope this helps!

Detect if colour beneath UIVisualEffectView is light

Because the UIImageView in the background is very light, you can't see the text in the foreground on top of the UIVisualEffectView. I want to detect whether the background is light or not and if so, change the text colour to something darker. How can I do this?
To detect the dominant color of a UIView it takes two steps. First is to capture the image data of the view as described here: How to capture UIView to UIImage without loss of quality on retina display
Second is to determine what the dominant color of the view is as described here:
How does the algorithm to color the song list in iTunes 11 work?
And then make your adjustments based on the result.
Personally, I would simply use a dark text color for the light blur. Or continue with the light text and use the dark blur effect. Or set a tint color on a navigation bar.

iOS : Gradient semi transparent image overlay on

I need to make my scrollview to be transparent at top and bottom while the underneath text view could be scrolled like shown below.
I made one .png image in photoshop with gradient (black on top) and transparency at bottom.
When I added the image onto the Image view that is atop the scorllview, and run it on the simulator, the whole image is pure black and transparency gone.
Can someone please advise?
Set your imageView's background color to clear.
Also, wouldn't the image you need be white on bottom and transparent on top, rather than black on top and transparent on bottom?
My mistake... I have saved the image as JPG. not PNG. PNG is working properly. Thanks!

Remove Transparency From Glyph.Data in SpeedButtons

I have an old app (Delphi 5) which I want to give it some changes.
I have set a Glyph.Data for a speedbutton, but some colors are transparent and in some places I see small white dots on my image, I do not want to set transparency for the image, How to remove it (transparency)?
Any help is really appreciated.
Thanks :)
The transparency is a color that is not drawn.
You just have to change the image or set another color as the transparent one.
From Delphi 6 Help
Transparent color
Use the Transparent color drop-down to
specify which color is used to create
a mask for drawing the image
transparently. The default transparent
color is the color of the bitmap's
left-most pixel in the bottom line.
You can also change the transparent
color by clicking directly on a pixel
in the selected image.
When an image has a transparent color,
any pixels in the image of that color
are not rendered in that color, but
instead appear transparent, allowing
whatever is behind the image to show
through.
If the image is an icon, Transparent
color appears grayed and the
transparent color is set to clNone.
This is because icons are already
masked.
Set TSpeedButton.Transparent to False.
I have found the answer, Delphi thinks the transparent color is the color of most left - bottom pixel of this image. So If I set a color which is not used in my image in the most left-bottom of my image, then Delphi only will make that small pixel transparent and other parts of my image will be OK without transparency, So this post is completed by myself :))

Resources