Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 639
  • Last Modified:

photo gallery

is there a way to have photos display just like a camera roll but use the photos from a folder instead of the pictures from my library?
0
BTMExpert
Asked:
BTMExpert
  • 3
  • 3
1 Solution
 
iPinkyCommented:
you can use "quick look": select all images in a folder and hit the spacebar, that's the cheapest and easiest way…

there are third party tools who let you view pictures from folders (insteas of from you iPhoto Library), check out xee (http://wakaba.c3.cx/s/apps/xee.html) or CocoViewX( http://www.stalkingwolf.net/software/cocoviewx/)  
0
 
BTMExpertAuthor Commented:
thank you for the response but i need something for the iphone.  The iphone camera roll shows pictures in a tiled or grid view.  I want to know how you do that but instead of using images from the camera library, use pictures from a folder I'm creating.
0
 
pgnatyukCommented:
I don't think that my answer will be enough for you. Because of that I didn't answer before.
I do not think it is a grid view. From my point of view it is an image that contains all images from the folder. Let's say that screen size is 480x320, so you decide to show the images from the folder in the same proportion. For example 48x32. So you take each image from the folder, scale and copy it to the big image into the 0 position - first rectangle in the first line. Then you take the second image, scale it and copy to the second rectangle of the first line. And so on. The result image you show on the screen.
I really do not want to make a code for it.  
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
BTMExpertAuthor Commented:
i think i'm trying that with this:

scrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
      //scrollView.delegate = self;
      scrollView.bouncesZoom = YES;
      scrollView.backgroundColor = [UIColor blackColor];
      
      containerView = [[UIView alloc] initWithFrame:CGRectZero];
      [scrollView addSubview:containerView];
      
      CGFloat maximumWidth = 0.0;
      CGFloat totalHeight = 0.0;
      CGFloat totalWidth = 0.0;
      
      for(int i = 1; i <= 11; i++) {
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", i]];
            if(totalWidth > 320) {
                  totalWidth = 0;
            }
            
            CGRect frame = CGRectMake(totalWidth, totalHeight, image.size.width - 30, image.size.height - 30);
            UIImageView *imageView = [[UIImageView alloc] initWithFrame:frame];
            imageView.image = image;
            
            [containerView addSubview:imageView];
            [imageView release];
            
            maximumWidth = MAX(maximumWidth, image.size.width);
            totalHeight += image.size.height;
            totalWidth += image.size.width;
      }
      
      containerView.frame = CGRectMake(0, 0, 320, totalHeight);
      scrollView.contentSize = containerView.frame.size;


but my images don't go side by side or in a grid for that matter.  am i missing something in the frame loop?
0
 
pgnatyukCommented:
I'd say it's a wrong calculation. I can be wrong I do not know what you want.
Pay attention on these lines:

            CGRect frame = CGRectMake(totalWidth, totalHeight, image.size.width - 30, image.size.height - 30);

and

            maximumWidth = MAX(maximumWidth, image.size.width);
            totalHeight += image.size.height;
            totalWidth += image.size.width;

This code is supposed to do what? Can you explain?

0
 
BTMExpertAuthor Commented:
it places the image on the view inside the frame.  the totalwidth and totalheight are the position of the frames and the image sizes are the sizes of the frame.  so i'm trying to put them side by side so i keep adding the width of each image so i can get the position of the next image.  but maybe i'm missing something or maybe there's an easier way.
0
 
pgnatyukCommented:
On Mac OS X you can use Image Kit.
http://www.macresearch.org/cocoa-tutorial-image-kit-and-image-browser-views-part-i
It looks better and works faster. I do not know if exists something like that for iPhone.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Worried about phishing attacks?

90% of attacks start with a phish. It’s critical that IT admins and MSSPs have the right security in place to protect their end users from these phishing attacks. Check out our latest feature brief for tips and tricks to keep your employees off a hackers line!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now