Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

iphone - zooming from a particular point -


i using code zoom particular point

cgpoint getcenterpointforrect(cgrect inrect) {     cgrect screenrect = [[uiscreen mainscreen] bounds];     return cgpointmake((screenrect.size.height-inrect.origin.x)/2,(screenrect.size.width-inrect.origin.y)/2); }  -(void) startanimation {     cgpoint centerpoint = getcenterpointforrect(self.view.frame);     self.view.transform = cgaffinetransformmaketranslation(centerpoint.x, centerpoint.y);     self.view.transform = cgaffinetransformscale( self.view.transform , 0.001, 0.001);     [uiview beginanimations:nil context:nil];     [uiview setanimationduration:ktransitionduration];     self.view.transform = cgaffinetransformidentity;     [uiview commitanimations]; } 

its not working. correct way zooming particular point.

i think that, if i've diagnosed problem correctly, you're getting scaling animation view starts tiny , @ point, scales , moves centre of screen want, point starts @ incorrect?

first of all, views scale around centre. if took out translation , hence reduced code have to:

self.view.transform = cgaffinetransformmakescale( 0.001, 0.001); 

and view ends taking whole screen it'll remain centred on middle of screen, sort of little though it's long way away , you're heading directly towards it.

supposing instead want grow , move centre of screen (x, y) need more like:

cgpoint locationtozoomfrom = ... populated somehow ...; cgpoint vectorfromcentretopoint = cgpointmake(                locationtozoomfrom.x - self.view.center.x,                locationtozoomfrom.y - self.view.center.y);  self.view.transform = cgaffinetransformmaketranslation(vectorfromcentretopoint.x, vectorfromcentretopoint.y); self.view.transform = cgaffinetransformscale( self.view.transform , 0.001, 0.001); 

where locationtozoomfrom initial centre of view , normal centre per frame destination.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -