沿左边缘的Vim窗口填充(Vim window padding along left edge)
如何在vim窗口的左边缘添加间距? 沿窗口最左边的文本使其难以阅读。
How can I add spacing along the left edge of my vim window? Text along the very left edge of a window makes it difficult to read.
原文:https://stackoverflow.com/questions/6180067
更新时间:2023-11-25 15:11
最满意答案
能够在28分钟之后弄清楚这一点哦,好吧,这里有:
CGImageRef imageRef = CGImageCreateWithImageInRect([imageTaken CGImage], CGRectMake(0.0f, 0.0f, 960.0f, 960.0f)); [selectedImageView setImage:[UIImage imageWithCGImage:imageRef]]; CGImageRelease(imageRef);
通过在
960.0f
裁剪,我能够保持图片的原始质量,并且能够告诉我从哪个Y
“切割”它。 我还补充说:+ (UIImage*)rotate:(UIImage*)image andOrientation:(UIImageOrientation)orientation; { UIGraphicsBeginImageContext(image.size); CGContextRef context=(UIGraphicsGetCurrentContext()); if (orientation == UIImageOrientationRight) { CGContextRotateCTM (context, 90/180*M_PI) ; } else if (orientation == UIImageOrientationLeft) { CGContextRotateCTM (context, -90/180*M_PI); } else if (orientation == UIImageOrientationDown) { // NOTHING } else if (orientation == UIImageOrientationUp) { CGContextRotateCTM (context, 90/180*M_PI); } [image drawAtPoint:CGPointMake(0, 0)]; UIImage *img=UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return img; }
因为图片将向左旋转。
Was able to figure this out 28 minutes after, oh well, here it goes:
CGImageRef imageRef = CGImageCreateWithImageInRect([imageTaken CGImage], CGRectMake(0.0f, 0.0f, 960.0f, 960.0f)); [selectedImageView setImage:[UIImage imageWithCGImage:imageRef]]; CGImageRelease(imageRef);
By cropping at
960.0f
I am able to keep the original quality of the picture and also able to tell from whichY
I am able to "cut" it from. I also added this:+ (UIImage*)rotate:(UIImage*)image andOrientation:(UIImageOrientation)orientation; { UIGraphicsBeginImageContext(image.size); CGContextRef context=(UIGraphicsGetCurrentContext()); if (orientation == UIImageOrientationRight) { CGContextRotateCTM (context, 90/180*M_PI) ; } else if (orientation == UIImageOrientationLeft) { CGContextRotateCTM (context, -90/180*M_PI); } else if (orientation == UIImageOrientationDown) { // NOTHING } else if (orientation == UIImageOrientationUp) { CGContextRotateCTM (context, 90/180*M_PI); } [image drawAtPoint:CGPointMake(0, 0)]; UIImage *img=UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return img; }
Because the picture is coming rotated to the left.
相关问答
更多-
信号大小错误(Bluetooth socket wrong signal size)[2022-06-14]
我不认为这个错误与蓝牙核心规范有关。 由于LT_ADDR是3位值,其中0被保留用于广播,所以不可能有超过7个激活的从站。 从规范Vol.2 B部分4.2节 在微微网中活动的每个从设备都被分配一个主要的3位逻辑传输地址(LT_ADDR)。 [...] LT_ADDR只有在从机处于活动模式时才有效。 同样来自第6.4.1节 该字段[LT_ADDR]指示主 - 从传输时隙中的分组的目的地从站(或广播情况下的从站),并指示从站用于从站到主站的传输时隙。 我认为关键是活跃这个词。 8.6节定义了主动模式和主动从站。 ... -
第一个单元大小错误(First cell wrong size)[2023-07-23]
为了使用单元格的大小,您必须实现UITableViewDelegate函数 func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { if indexPath.row == 0 { return firstCellHeight } else { return customCellHeight } In order to play with the s ... -
解压缩文件大小错误(Decompress file with wrong size)[2023-08-11]
我的猜测是,当GZipping文件时,另一端会出错。 看起来它没有正确设置ISIZE字节 。 ISIZE字节是有效GZip文件的最后四个字节 ,位于32位CRC值之后,后者又直接在压缩数据字节之后。 对于这样的错误,7-Zip似乎很强大,而GZipStream则不然。 然而奇怪的是7-Zip没有向您显示任何错误。 它应该告诉你(用7-Zip 16.02 x64 / Win7测试)...... 如果大小错误,CRC错误, 如果部分或全部ISIZE字节被切断,“意外的数据结束”, “有效载荷数据结束后有一些数据 ... -
从UIViewController引用( 链接 ): presentViewController:动画:完成: 讨论 在iPhone和iPod touch上,呈现的视图始终为全屏 如果要嵌入图像选择器,则应手动将其视图添加到其他视图中。 From UIViewController reference (link): presentViewController:animated:completion: Discussion On iPhone and iPod touch, the presented vie ...
-
事实证明,iAd实际上工作正常,但Apple尚未修改测试广告的尺寸以适应iPhone 6和6 Plus。 2014年11月25日更新 - Apple现在更新了iAd横幅以显示正确的尺寸。 It turns out that iAd is actually working fine, but Apple has not yet modified the dimensions of the test ad to suit the iPhone 6 and 6 Plus. Update 25th Nov 2014 ...
-
在IOS 5 UIWebView报告滚动视图的内容大小错误(On iOS 5, UIWebView is reporting wrong content size for scroll view)[2022-05-02]
我会分解终于为我解决这个问题。 我不得不在我的内容中包装。 %@ 执行下面的视图确实加载。 -(void)webViewDidFinishLoad:(UIWebView *)webView { [self layoutSubviews]; ... -
我猜你在创建显示文本的视图时,你忽略了NSTextField和NSTextView都有他们的文本从他们的框架插入一点。 例如,如果您正在使用NSZeroSize ,请将textContainerInset设置为NSZeroSize ,看看它是否更好。 I’m guessing when you create the views that are displaying the text, you’re ignoring that NSTextField and NSTextView both have the ...
-
我通过以下方式解决了问题:而不是试图找出属性。 我从相机计算图像的纵横比,以及屏幕的纵横比。 之后,我重新缩放图像,保持原生的宽高比。 它允许我找到相机标准杆的高度。 I came to solution in the following way: Instead of trying to figure out properties. I calculate aspect ratio of image from camera, and aspect ratio of screen. After that I ...
-
能够在28分钟之后弄清楚这一点哦,好吧,这里有: CGImageRef imageRef = CGImageCreateWithImageInRect([imageTaken CGImage], CGRectMake(0.0f, 0.0f, 960.0f, 960.0f)); [selectedImageView setImage:[UIImage imageWithCGImage:imageRef]]; CGImageRelease(imageRef); 通过在960.0f裁剪,我能够保持图片的原始质 ...
-
首先,数组不是指针,反之亦然。 在你的代码中, S.tab是一个指针,并且在指针上使用sizeof将计算指针本身的大小,而不是指向该指针的内存量。 在您的平台上,指针( int * )的大小为4个字节,因此您始终可以看到输出为4。 如果你有一个正确的以null结尾的char数组,你可以使用strlen()来获取字符串元素的长度,但是,仍然可能无法给你分配的内存的实际大小。 您需要自己跟踪大小。 通常,您不能指望从指针本身提取信息。 First of all, arrays are not pointers, ...