I am using an ImageView.
Having a picture inside, working well as aspected with 10.9 sdk.
[_myImageView setImage:myImage];
Since 10.10 sdk the picture has transparency. (10.11 too)
Has anyone a hint of the common way to get the transparency out of the picture?
Thank you!
Related
I'm using free images off of iconfinder and they work fine. However I couldn't find a specific image so had to find the image elsewhere.
Anyway the image was an incorrect size so I resized it in photoshop.
I added the image to the images.xcassets folder and used the image for the uibarbuttonitem.
The image has come out as a grey square box.
Highlighting works but all I see is a box.
Am I missing something here?
Would appreciate some help thanks.
Make sure the image is a PNG. What is the size of the image you are using?
Apple's iOS HIG
I had to change a setting in photoshop. When saving the photo I had to make sure interlanced was chosen.
I need to create a very simple image cropping interface for an OS X cocoa application, but I am not sure where to start. The user needs to be able to choose a crop size from a menu of presets, be presented with a cropping rectangle that can be resized preserving the ratio, and moved around the image until they finally apply the selected crop to the image.
I've done some searching for sample code and projects but not found anything too useful. Core Image fun house has some pointers but is a retired sample. There are lots of iOS examples, but I've not found an easy to follow Mac OS example.
Can someone point me in the right direction (or at a sample project or framework!!).
Thanks a lot.
Here is a project you can look at:
https://github.com/foundry/drawingtest
It's a little demo I made as I was trying to understand the relationship between the rects in this method:
- (void)drawInRect:(NSRect)dstRect
fromRect:(NSRect)srcRect
operation:(NSCompositingOperation)op
fraction:(CGFloat)delta
Note that the older compositeToPoint: methods are deprecated and should not be used for this sort of thing.
srcRect is the portion of the original image (in it's own coordinates) that you want to keep.
dstRect is the rect that you want that cropped area to draw into.
JMRect in the project is an NSObject representation of an NSRect - so that we can use cocoa bindings to tie the interface controls together.
For your UI, the cropping rectangle could just be a transparent subview view with a border that you push around and resize over the image you want to crop.
This is by no means a complete solution to your question, but it's something you can poke around with - it might help you to get started.
I'm developing a iOS app that is using custom UIButtons with round shape. I wanted to add Image to these buttons and would like to know if I use IB to select an image from my project, do I have to also worry about 2x retina images for retina display?. What should be the image size for both non-retina and retina devices (all iPhones (including iphone 5) and iPad including mini) when I embedded them from IB?
Is there a best resource available on the Internet to get these pngs files for buttons?
Yes you should use all the images. you should just add the images with proper names to the resources folder. And just select the non-retina image rest the compiler will take care of.
http://www.idev101.com/code/User_Interface/sizes.html
The above link will help you with the images sizes
It is easy. Goto interface builder and on the right hand panel you will see this -
All you need to do is first configure your button as custom then include a image file in your project through xcode and then you can select that image in the dropdown in background or image property.
Note that all this is possible to do through code also, its just that IB makes it interactive. Hope this helps.
I have around 100 PNGs (that I created) that I want to create an animation out of. I however created the animation in a vector graphics editor, therefore each PNG has a white background. How do I make Xcode not show the white background and instead just the image itself? I will be displaying the animation in a transparent window, so a background completely ruins the effect.
Note I'm using Xcode 3.2.6 on Snow Leopard. I'm specifically asking about a Mac application not an iOS one.
I recommend exporting your images again with a transparent background. That would save you a lot of trouble. If that's not an option, have a look at Quartz 2D Masks.
In my application I have a color video which I want to make as black and white video. Is there any framework that supports this in iOS? If so, how to implement that effect on color video?
Can anyone help in this regard?
A bit late here, but you should check out OpenCV.
It can be compiled as a static lib for the iPhone and can convert video (frame by frame) to grayscale or two color.
You can start here. There are other resources for doing this floating around.
HI Lakshmi this might be familiar to you that at least 24 frames make a clip of video so you have to use a tool like movie maker so that you can see the video frame by frame and edit each frame.
See the opensource Framework named: GPUImage https://github.com/BradLarson/GPUImage/
The filter name GPUImageGrayscaleFilter is what you want
This framework included the sample code, so you can learn how to use GPUImageGrayscaleFilter in your apps easily