首页 \ 问答 \ 沿左边缘的Vim窗口填充(Vim window padding along left edge)

沿左边缘的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 which Y 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.

相关问答

更多
  • 我不认为这个错误与蓝牙核心规范有关。 由于LT_ADDR是3位值,其中0被保留用于广播,所以不可能有超过7个激活的从站。 从规范Vol.2 B部分4.2节 在微微网中活动的每个从设备都被分配一个主要的3位逻辑传输地址(LT_ADDR)。 [...] LT_ADDR只有在从机处于活动模式时才有效。 同样来自第6.4.1节 该字段[LT_ADDR]指示主 - 从传输时隙中的分组的目的地从站(或广播情况下的从站),并指示从站用于从站到主站的传输时隙。 我认为关键是活跃这个词。 8.6节定义了主动模式和主动从站。 ...
  • 为了使用单元格的大小,您必须实现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 ...
  • 我的猜测是,当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 ...
  • 我会分解终于为我解决这个问题。 我不得不在我的内容中包装。 %@ 执行下面的视图确实加载。 -(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, ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)