Tag: 旋转

Python列表旋转

可能重复: 有效的方法来移动Python中的列表 我想通过任意数量的项目向右或向左旋转Python列表(后者使用负参数)。 像这样的东西: >>> l = [1,2,3,4] >>> l.rotate(0) [1,2,3,4] >>> l.rotate(1) [4,1,2,3] >>> l.rotate(-1) [2,3,4,1] >>> l.rotate(4) [1,2,3,4] 这可怎么办?

JS客户端Exif方向:旋转和镜像JPEG图像

数码相机的照片经常被保存为带有EXIF“方向”标签的JPEG格式。 为了正确显示,图像需要根据设置的方向进行旋转/镜像,但是浏览器会忽略渲染图像的这些信息。 即使在大型商业Web应用程序中,对EXIF方向的支持也可能是多余的1 。 同样的来源也提供了JPEG可以具有的8个不同方向的很好的总结: 示例图像可在4 。 问题是如何旋转/镜像客户端的图像,使其正确显示,并可以进一步处理,如果有必要? 有JS库可用来parsingEXIF数据,包括方向属性2 。 Flickr注意到parsing大图片时可能出现的性能问题,需要使用webworkers 3 。 控制台工具可以正确地重新定位图像5 。 6解决问题的PHP脚本

在JPanel中旋转BufferedImage

我想旋转一个BufferedImage并将其显示在一个JLabel (这是一个JPanel )。 目前的结果产生一个黑色背景旋转10度的白色方形,但图像不存在于广场内。 我知道myPicture不是空白的,因为当不旋转的时候, myPicture本身在JPanel内部正确显示。 这里是代码: int w = myPicture.getWidth(); int h = myPicture.getHeight(); BufferedImage newImage = new BufferedImage(w, h, myPicture.getType()); Graphics2D graphic = newImage.createGraphics(); graphic.rotate(Math.toRadians(10), w/2, h/2); graphic.drawImage(myPicture, null, 0, 0); picLabel.setIcon(new ImageIcon(newImage));

Java:旋转图像

我需要能够单独旋转图像(在Java中)。 到目前为止,我唯一发现的是g2d.drawImage(image,affinetransform,ImageObserver)。 不幸的是,我需要在一个特定的点上绘制图像,而且没有任何方法可以使图像单独旋转,并且允许我设置x和y。 任何帮助表示赞赏

CSS3旋转animation

<img class="image" src="" alt="" width="120" height="120"> 不能让这个animation图像工作,它应该做一个360度旋转。 我想下面的CSS有些问题,因为它只是保持不动。 .image { float: left; margin: 0 auto; position: absolute; top: 50%; left: 50%; width: 120px; height: 120px; margin-top: -60px; margin-left: -60px; -webkit-animation-name: spin; -webkit-animation-duration: 4000ms; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: linear; -moz-animation-name: spin; -moz-animation-duration: 4000ms; -moz-animation-iteration-count: infinite; -moz-animation-timing-function: linear; -ms-animation-name: spin; -ms-animation-duration: 4000ms; -ms-animation-iteration-count: infinite; -ms-animation-timing-function: linear; animation-name: spin; […]

Android:从图库加载的位图在ImageView中旋转

当我从媒体库加载一个图像到一个位图,一切都工作正常,除了用相机拍摄的照片,而垂直拿着手机,旋转,使我总是得到一个水平的图片,即使它出现在垂直的画廊。 为什么是这样的,如何正确加载它?

如何创buildiphone的摇摆图标效果?

我想在我的应用程序中来回晃动图像,类似于iPhone图标在按下时摆动的方式。 什么是最好的方式来做到这一点? 这是我第一次尝试不使用animationGIF的animation。 我认为这个想法是稍微旋转图像来创造摇摆的效果。 我看过使用CABasicAnimation和CAKeyframeAnimation。 CABasicAnimation每次重复都会产生一个抖动,因为它跳转到from位置,并且不会内插回来。 CAKeyframeAnimation似乎是解决scheme,除了我不能得到它的工作。 我一定会错过一些东西。 这是我的代码使用CAKeyframeAnimation(不起作用): NSString *keypath = @"wobbleImage"; CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:keypath]; animation.duration = 1.0f; animation.delegate = self; animation.repeatCount = 5; CGFloat wobbleAngle = 0.0872664626f; NSValue *initial = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(0.0f, 0.0f, 0.0f, 1.0f)]; NSValue *middle = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(wobbleAngle, 0.0f, 0.0f, 1.0f)]; NSValue *final = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(-wobbleAngle, 0.0f, 0.0f, 1.0f)]; […]

如何在iOS中处理不同的方向

补充 :你可以在github ios6rotations上访问这个项目 对不起,在iOS 6中提问有关屏幕旋转的问题,但这真的是一个痛苦的屁股..我仍然无法完全理解 – 由于某种原因,它在某些情况下行为不同。 我在testing应用程序中有以下简单的视图层次结构: 我试图达到的目的是 – 只将蓝色控制器保持在风景中,而红色控制器只能用于风景 。 我有这样的代码里面的UINavigationController的子类: @implementation CustomNavController – (BOOL)shouldAutorotate { return [[self.viewControllers lastObject] shouldAutorotate]; } – (NSUInteger)supportedInterfaceOrientations { return [[self.viewControllers lastObject] supportedInterfaceOrientations]; } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return [[self.viewControllers lastObject] preferredInterfaceOrientationForPresentation]; } @end 在我的蓝色控制器中我实现了这个: – (BOOL)shouldAutorotate { return YES; } – (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskLandscape; } 而在红色的控制器中: – […]

从一个旋转的矩形计算边界框坐标

我有一个矩形的左上angular的坐标以及它的宽度,高度和旋转从0到180和-0到-180。 我正在尝试获取矩形周围实际框的边界坐标。 计算边界框坐标的简单方法是什么? Min y,max y,min x,max x? A点并不总是在最小范围内,它可以在任何地方。 如果需要,我可以在as3中使用matrix转换工具包。

获取元素-moz-transform:在jQuery中旋转值

我有一个图层的CSS样式: .element { -webkit-transform: rotate(7.5deg); -moz-transform: rotate(7.5deg); -ms-transform: rotate(7.5deg); -o-transform: rotate(7.5deg); transform: rotate(7.5deg); } 有没有一种方法可以通过jQuery获得医生轮值? 我试过这个 $('.element').css("-moz-transform") 结果是matrix(0.991445, 0.130526, -0.130526, 0.991445, 0px, 0px) ,这并没有告诉我很多。 我想要得到的是7.5 。