Mac Cocoa |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Sep 23, 2008 11:35 pm Post subject: Pictures & Images |
|
|
SO - How can I take a photo with my iPhone app?
"The UIImagePickerController class lets you take pictures or choose them
from the photo library. Specify the source type as UIImagePickerController-
SourceTypeCamera." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Wed Sep 24, 2008 4:25 pm Post subject: |
|
|
SO - How to tint a UIButton?
"Is there a way to load a grayscale PNG and adjust it to the color I want?
Better yet, is there a way to get Apple's glassy look without having to load
custom images at all?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Sep 27, 2008 12:51 am Post subject: |
|
|
Geoff Teehan: iPhone GUI PSD
"Since we know we’ll be doing more of this, we created our own Photoshop
file that has a fairly comprehensive library of assets – all fully editable." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Thu Oct 09, 2008 8:54 pm Post subject: |
|
|
SO - How to save picture to iPhone photo library?
"What do I need to do to save an image my program has generated (possibly
from the camera, possibly not) to the system photo library on the iPhone?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Oct 10, 2008 9:29 am Post subject: |
|
|
How to identify which device the user is on?
"My app can take a photo, but I want to disable this for 1st gen iPod Touch
owners. How do I know what device the app is running on?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Oct 19, 2008 2:38 am Post subject: |
|
|
SO - How can I upload a photo to a server with the iPhone? - OMG!
"I'm writing an iPhone app that takes a photo and then uploads it to a server.
How do I upload a photo to a server with Cocoa in Xcode? I suppose I use NSUrl
somewhere." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Sat May 02, 2009 8:16 pm Post subject: |
|
|
SO - JPEG Quality when creating a JPEG in Carbon
"I'm writing a Carbon application and we are creating JPEG files. I'm currently
doing this by using Quartz CGImageDestinations and kCGImagePropertyJFIF-
Dictionary." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu May 14, 2009 9:47 pm Post subject: |
|
|
MF - How to crop an image?
"One way is to use CGImageCreateWithImageInRect()." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Jun 02, 2009 1:39 pm Post subject: |
|
|
MF - iPhone Screenshots
"I am able to easily create screenshots but was wondering if people knew
how to create a nice frame around the screenshot (i.e. iPhone frame) like
lots of the screenshots here." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Jun 05, 2009 12:51 am Post subject: |
|
|
iphonedevsdk.com - Splash Screen
"I would like to play the video before anything else happens like in poker5k." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Wed Jul 15, 2009 9:42 pm Post subject: |
|
|
SO - Any idea why this image masking code does not work?
"I have this code to mask an image. Basically, I only work with PNG images.
So I have a 300x400 PNG image with 24bits of color (PNG-24). I am not sure
if it also has an alpha channel. But there's no transparency in it." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Aug 08, 2009 8:17 pm Post subject: |
|
|
MF - Saving CGImage to disk
"I have a UIImage that I want to write to disk as PNG. The thing is that for
some reason I don't want to use the UIImagePNGRepresentation. That's be-
cause I want to do stuff with the original CGImage embedded in the UIIma-
ge before I make the save." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Aug 15, 2009 1:38 am Post subject: |
|
|
iphonedevsdk.com - Rounded corners to images
"You can also clip the imageView to a path. Ms Sadun has a good recipe
on page 52 of her book for clipping a view to a circular path, but can be
modified to clip corners." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Fri Aug 28, 2009 4:43 pm Post subject: |
|
|
so - Memory management when using UIImage
"My application heavily uses the UIImage object to change images on a sin-
gle UIImageView based on user input and the previous image which was set.
I use [UIImage imageNamed:] to create my UIImage objects.
I guess this is not the best way to use UIImage coz my memory usage ke-
eps increasing with time and never drops." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Wed Oct 28, 2009 12:42 pm Post subject: |
|
|
MF - Cocoa/Objective-C: crop and save an image
RD: "I would suggest that you can use addRepresentation: and add a
NSBitmapImageRep (or check if there is one first). Once you have an
NSImageBimapRep you can use representationUsingTyperoperties: with
NSPNGFileType and nil properties to get PNG data to write to a file." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Nov 07, 2009 7:40 pm Post subject: |
|
|
MF - Data binding is deprecated?
"This is related to binding the imageWell under the data binding. If the data
binding is indeed deprecated then what do I use?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Apr 16, 2010 9:36 pm Post subject: |
|
|
SO - Faster way to draw an image
"I'm trying to combine two images into a single image. unfortunately this
has to be done very quickly in response to a user sliding a UISlider. i can
combine the two images into a single image no problem. but the way I'm
doing it is horribly slow." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue May 11, 2010 7:23 pm Post subject: |
|
|
MF - NSImage Built-In Images Reference
"For example when you use [NSImage imageNamed:@"NSInfo"], you
will get an image of an i inside a blue circle. In interface builder, the Me-
dia browser lists some of these, though the list is hardly exhaustive." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Wed Jul 21, 2010 10:16 pm Post subject: |
|
|
so - iPhone iOS 4.0 Camera FigCreateCGImageFromJPEG
returned -1
"Hi, Since I updated to 4.0, when I take a photo with my App using
UIImagePickerController I get the following error output:
* ERROR: FigCreateCGImageFromJPEG returned -1. Input (null) was
711733 bytes." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Sep 29, 2010 11:11 pm Post subject: |
|
|
Scott Means - iPhone programming: fun with grayscale images
"So I was trying to do something that I thought was simple. I needed to
convert an image from full color to grayscale in my iPhone application, and
I easily found the CGColorSpaceCreateDeviceGray method which seemed
to put me on the right track. But the complication came when I tried to use
this color space with CGBitmapContextCreate. I got this error in the console:
<Error>: CGBitmapContextCreate: unsupported parameter combination: 8 integer bits/component;
16 bits/pixel; 1-component colorspace; kCGImageAlphaPremultipliedLast; 1472 bytes/row.
So the combination of parameters was incorrect." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Oct 04, 2010 9:33 pm Post subject: |
|
|
iphonedevsdk.com - Getting GPS data from Image Exif
"I`m thinking that the UIImage that came from the picker don`t have exif
meta data, I`m right? This lib can`t be used with image picker?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Oct 09, 2010 1:00 am Post subject: |
|
|
Jeff LaMarche - Cutting Large Images into Tiles for UIScrollView
"Tile Cutter is rather bare bones and was developed in about a half-day, but
it seems to work well. I was able to slice up a 1.3 gig image (yes, really) into
400x400 chunks in about 15 minutes on my laptop." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Dec 03, 2010 12:13 am Post subject: |
|
|
Jeff LaMarche - Drawing Part of a UIImage
"On the Mac, NSImage has a handy instance method called drawInRect:-
fromRect:operation:fraction: that lets you specify exactly which part of an
image to draw. On UIImage, we've only got the ability to draw the entire
image either unless we drop down to Core Graphics calls. We don't have
a nice, easy, convenient way using just UIImage to draw a portion of the
image it represents." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
Posted: Sun Jan 09, 2011 11:25 pm Post subject: |
|
|
MF - How to slice image to tiles?
"I found a AnimatedGif class on Internet, do you think which way is better?
UIWebView or AnimatedGif?" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Mon Feb 07, 2011 9:07 pm Post subject: |
|
|
MF - How to use UIImage to resize as background
"Try using setBackgroundImage:forState: instead, as seen in the UICatalog
sample code.
...
When used in conjuction with stretchableImageWithLeftCapWidth:topCap-
Height:, only the center part of the image will scale." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Thu Mar 03, 2011 7:04 pm Post subject: |
|
|
MF - NSImage size?
"An NSImage's size property takes resolution (PPI) into account.
If you want dimensions in pixels, then you need an NSImageRep and its
pixelsHigh and pixelsWide methods." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue May 24, 2011 9:27 am Post subject: |
|
|
github.com - Moodstocks / moodstocks-iphone-sdk
"A library to integrate image recognition into your iPhone mobile applications
in seconds." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Aug 15, 2011 12:14 pm Post subject: |
|
|
github.com - SDWebImage
"Asynchronous image downloader with cache support with an UIImageView
category" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Fri Mar 23, 2012 4:40 pm Post subject: |
|
|
Bob McCune - iOS 5 Face Detection with Core Image
"One of the great new features of iOS 5 is the addition of the Core Image
(CI) framework. This framework has been available for a few years on the
Mac, but now its advanced image processing and filtering capabilities are
available on the iOS platform as well" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Apr 25, 2012 9:57 pm Post subject: |
|
|
J. Duncan Davidson - WebKit Limit on Retina JPG Image Display
"Bottom line, however, is that there’s a limit to serving up web images in
JPG format with WebKit the new iPad and the limit kicks in when you ap-
proach screen-filling resolutions. Hopefully, a future update can lift the
limits just a bit so that it’s possible to display full-screen images in Safari
that look as great as full-screen images do elsewhere on the system." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri May 04, 2012 10:34 pm Post subject: |
|
|
mf - Why UIImageView not round corner?
I have a UIImageView on UIView, I use code as below to draw round corner,
but it doesn't work, what can I do?
Code: | self.icon.image = [UIImage imageNamed:@"icon-72.png"];
self.icon.layer.masksToBounds = YES;
self.icon.layer.cornerRadius = 10.632f; |
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Mon Sep 24, 2012 3:48 pm Post subject: |
|
|
Trevor’s Bike Shed - Resize a UIImage the right way
"The following sections describe yet another collection of source code for
resizing UIImage objects. Functionally, it is similar to code samples that
can be found elsewhere on the Internet in discussion forums and blogs,
but it consolidates their features into a self-contained, reusable package
and offers several notable improvements..." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Thu Jan 03, 2013 1:20 am Post subject: |
|
|
Swipe Through Images
http://forums.macrumors.com/showthread.php?t=1517376
I have a uicollectionview that shows the newest 50 images from a Flickr page. I can tap a thumbnail cell and show a larger image. Everything works just fine but I can't figure out how to simply swipe through the images once I've tapped on one. |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Jul 31, 2013 5:39 pm Post subject: |
|
|
Andrey Chevozerov - Tips for Using UIImage Objective-C Class
"Today, I'm going to suggest several unusual ways of using UIImage to
fill an area with a texture, create a stretchable UI element, changing and
masking an image." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Aug 12, 2013 11:57 pm Post subject: |
|
|
Johannes Treitz - The algorithm for a perfectly balanced photo gallery
"Ever since we started working on Chromatic we knew we wanted the photos
to be as big as possible. No tiny thumbnails, no square-cropping, no wasting
of precious screen real estate.
Galleries typically have between 10 and 100 photos with various aspect ra-
tios (that's width divided by height) and we want them to be equally distri-
buted over the rows, taking up all the space available." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 532
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Feb 02, 2018 6:08 pm Post subject: |
|
|
git - SDWebImage
"This library provides an async image downloader with cache support.
For convenience, we added categories for UI elements like UIImageView,
UIButton, MKAnnotationView.
Categories for UIImageView, UIButton, MKAnnotationView adding web image and cache management
An asynchronous image downloader
An asynchronous memory + disk image caching with automatic cache expiration handling
* background image decompression
* guarantee that the same URL won't be downloaded several times
* guarantee that bogus URLs won't be retried again and again
* guarantee that main thread will never be blocked
Performances!
Use GCD and ARC" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Sat Jun 15, 2019 11:26 pm Post subject: |
|
|
https://blog.schiavo.me/posts/scanning-documents/
Scanning documents with Vision and VisionKit on iOS 13
In iOS 13, Apple's Vision framework also adds support for OCR (Optical
Character Recognition), which allows you to detect and recognize text on
scanned documents!
git - WeScan framework
"Objective-C:
Create a dummy swift class in your project. When Xcode asks if you'd like to
create a bridging header, press 'Create Bridging Header'
In the new header, add the Objective-C class (#import myClass.h) where
you want to use WeScan
In your class, import the header (import <yourProjectName.swift.h>)
Drag and drop the WeScan folder to add it to your project
In your class, add @Class ImageScannerController;"
Read more about it: Adding document scanning to your app with WeScan/
Tesseract on git: Pocket-OCR
"This project is a demonstration of implementing the Tesseract OCR engine on
the iPhone platform. It works best with the iPhone 3GS and it's autofocus lens.
External lenses for older iPhones may be necessary for optimal image capture."
git - Tesseract OCR iOS
"Use Tesseract OCR in iOS 9.0+ projects written in either Objective-C or
Swift. Easy and fast."[/url][/b]
Last edited by Ike on Sat Jun 17, 2023 9:27 pm; edited 4 times in total |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Oct 18, 2019 6:49 pm Post subject: |
|
|
git - NYTPhotoViewer
"NYTPhotoViewer is a slideshow and image viewer that includes double-tap
to zoom, captions, support for multiple images, interactive flick to dismiss,
animated zooming presentation, and more." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Sat Jul 17, 2021 10:24 pm Post subject: |
|
|
git - Public domain image loader
"JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
PNG 1/2/4/8/16-bit-per-channel
TGA (not sure what subset, if a subset)
BMP non-1bpp, non-RLE
PSD (composited view only, no extra channels, 8/16 bit-per-channel)
GIF (*comp always reports as 4-channel)
HDR (radiance rgbE format)
PIC (Softimage PIC)
PNM (PPM and PGM binary only)" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Wed Aug 09, 2023 2:38 pm Post subject: |
|
|
so - Images in NSButton and NSImageView Blurred
"NSImage doesn't have any concept of high resolution - it just uses the
smallest image that has more pixels than the space it has to fill - so if your
NSImageView is bigger in dimension than your 1x image it will use the 2x
image as it has more pixels." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3156 Location: Europe
|
Posted: Mon Apr 29, 2024 8:41 pm Post subject: |
|
|
so - Vertical flip of CGContext
Code: | + (UIImage *) flipImageVertically:(UIImage *)originalImage {
UIImageView *tempImageView = [[UIImageView alloc] initWithImage:originalImage];
UIGraphicsBeginImageContext(tempImageView.frame.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGAffineTransform flipVertical = CGAffineTransformMake(
1, 0, 0, -1, 0, tempImageView.frame.size.height
);
CGContextConcatCTM(context, flipVertical);
[tempImageView.layer renderInContext:context];
UIImage *flipedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[tempImageView release];
return flipedImage;
} |
|
|
Back to top |
|
|
|