Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 07-07-2010, 09:43 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 4
gminghon is on a distinguished road
Default please help on CGAffineTransformTranslate

my problem is the i cant set the camera viewfinder position when my i hit the action button "hitmeFunc"
but if i push d action button "buttonPressed" when camera loaded the viewfinder actually move!
please help me out im using version 3.1.2 on iphone 2g.
here is my code.

Code:
-(IBAction) hitmeFunc{
	self.pick = [[UIImagePickerController alloc]init];
	self.pick.delegate = self;
	pick.sourceType = UIImagePickerControllerSourceTypeCamera;
	pick.showsCameraControls = NO;
	pick.navigationBarHidden = YES;
	pick.toolbarHidden = YES;
	pick.wantsFullScreenLayout = NO;

	NSLog(@"1:%f,%f",pick.cameraViewTransform.ty,pick.cameraViewTransform.tx); //<-- first i get 0.00, 0.00 here.

	pick.cameraViewTransform = CGAffineTransformScale(pick.cameraViewTransform, 0.5, 0.5);
	pick.cameraViewTransform = CGAffineTransformTranslate(pick.cameraViewTransform, 50.0, 100.0);

	NSLog(@"2:%f,%f",pick.cameraViewTransform.ty,pick.cameraViewTransform.tx); //<-- second i get 50.0, 25.0 here.
	
	UIButton *btnCapture = [UIButton buttonWithType:UIButtonTypeRoundedRect];
	btnCapture.frame = CGRectMake(0, 430, 320, 40);
	[btnCapture addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside];
	[pick.view addSubview:btnCapture];
	
	
	
	[self presentModalViewController:pick animated:NO];
	pick.cameraViewTransform = CGAffineTransformTranslate(pick.cameraViewTransform, 50.0, 100.0);
	[pick release];
	NSLog(@"3:%f,%f",pick.cameraViewTransform.ty,pick.cameraViewTransform.tx); //third i get 100.00, 50.00
}

-(IBAction) buttonPressed:(id) sender{
	NSLog(@"buttonPressed1:%f,%f",pick.cameraViewTransform.ty,pick.cameraViewTransform.tx); //after camera loaded i push this button
//i get buttonPressed1:50.00,25.00
	pick.cameraViewTransform = CGAffineTransformTranslate(pick.cameraViewTransform, 50.0, 100.0);
	NSLog(@"buttonPressed2:%f,%f",pick.cameraViewTransform.ty,pick.cameraViewTransform.tx); //<- and here i get 100.00, 50.00
}
gminghon is offline   Reply With Quote
Old 07-08-2010, 02:24 PM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 74
xyster is on a distinguished road
Default

Apparently displaying the controller with the modal view changes the transform somewhere later in the run loop.
Perhaps, instead you can wait for it to appear and then create an animation to move the view to where you want it.
xyster is offline   Reply With Quote
Old 07-08-2010, 08:05 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 4
gminghon is on a distinguished road
Default

Quote:
Originally Posted by xyster View Post
Apparently displaying the controller with the modal view changes the transform somewhere later in the run loop.
Perhaps, instead you can wait for it to appear and then create an animation to move the view to where you want it.
thanks xyster... and could u provide me some sample for this?
gminghon is offline   Reply With Quote
Old 07-13-2010, 08:04 PM   #4 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 4
gminghon is on a distinguished road
Default

anyone?
gminghon is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 380
9 members and 371 guests
AragornSG, baja_yu, ChrisYates, davejas69, guusleijsten, hussain1982, Kryckter, locombiano89, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,646
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, locombiano89
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:39 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0