UIBezierPath around UIImage with Transparency - ios

I have a series of images that are centered on top of a transparent background. I would like to add a white border to all of them and I could draw it if I had the path of the border of the opaque part of the image. Is it possible to extract this?

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.

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!

How do I draw a monochrome PDF with a tint color and opacity on iOS?

I need to draw a monochrome PDF in an iOS app, but replacing the color in the PDF with another color, and applying an opacity value. I'd like to show the result in a UIImageView or UIView.
I can draw the PDF using Quartz functions, but it is drawn black (the color of the original PDF). What would be the best way to do this?
I was able to accomplish this in the following way:
Draw the PDF into a transparent UIImage.
Set that image as the contents of a new CALayer, and set the size of the layer to be the same as the image.
Set the layer as the mask of a UIView's layer.
Set the background color (including opacity) of the view as desired.
It is not possible to implement this using the standard iOS PDF APIs.

Delphi TBitBtn white layer

How can I get rid of the white layer drawn under the bitmap images by Delphi/Windows when Glyph property of TBitBtn is used. I just want to draw the image, no shadow under it, no other layers that comes automatically. I am inserting round shaped 24 bit bitmap images.
Since you have a 24-bit bitmap, there is no alpha transparency, so Delphi uses the bottom left pixel of the image to determine the transparent color. All pixels with that color are treated as transparent. The part of the image with the shadow effect is not an exact match for the designated transparent color, so those pixels are painted normally, just like the rest of the image.
The shadow appears white because there was a white background in the graphic program when your designer applied the shadow effect.
Either edit the image to remove the shadow, or use a 32-bit image with alpha transparency. You'll be hard-pressed to apply alpha transparency after the fact. Fix the source image.

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