public static string GetPicThumbnail(SPFile file, string type)
{
    string thumbnail = "";

    string folderUrl = file.ParentFolder.ServerRelativeUrl;
    string fileName = file.Name;
    int expIndex = fileName.LastIndexOf('.');
    string subName = fileName.Substring(0, expIndex) + "_" + fileName.Substring(expIndex + 1) + ".jpg";

    if (type == "small")
    {
        thumbnail = folderUrl + "/_t/" + subName;//这是拿小图的;
    }
    else if (type == "big")
    {
        thumbnail = folderUrl + "/_w/" + subName;//这是拿大图的;
    }

    return thumbnail;
}

在picture library中取某一图片的大图、小图的更多相关文章

  1. document library\ picture library\Asset Library的默认文件夹

    document library\ picture library\Asset Library的默认文件夹? document library 默认文件夹:Forms picture library默 ...

  2. 基于Picture Library创建的图片文档库中的上传多个文件功能(upload multiple files)报错怎么解决?

    复现过程 首先,我创建了一个基于Picture Library的图片文档库,名字是 Pic Lib 创建完毕后,我点击它的Upload 下拉菜单,点击Upload Picture按钮 在弹出的对话框中 ...

  3. php从数据库中取二进制流文件转换为图片,图片以二进制流存入数据库实现

    php从数据库中取二进制流文件转换为图片,图片以二进制流存入数据库实现 function data_uri($contents, $mime) { $base64 = base64_encode($c ...

  4. 使用Python爬虫爬取网络美女图片

    代码地址如下:http://www.demodashi.com/demo/13500.html 准备工作 安装python3.6 略 安装requests库(用于请求静态页面) pip install ...

  5. VC++使用CImage在内存中Jpeg转换Bmp图片

    VC++中Jpeg与Bmp图片格式互转应该是会经常遇到,Jpeg相比Bmp在图片大小上有很大优势. 本文重点介绍使用现有的CImage类在内存中进行转换,不需要保存为文件,也不需要引入第三方库. Li ...

  6. python 爬取知乎图片

    先上完整代码 import requests import time import datetime import os import json import uuid from pyquery im ...

  7. 使用openxml提取word中的文本和图片并转为Html

    使用openxml提取word中的文本和图片 使用 openXml 提取 word 中的 Text 和 Drawing 使用 openXml 将 word 中的文本和图片转为Html 使用 openX ...

  8. 用WebCollector爬取站点的图片

    用WebCollector爬取整站图片,仅仅须要遍历整站页面.然后将URL为.jpg.gif的页面(文件)保存到本地就可以. 比如我们爬取一个美食站点,获取里面全部的图片: import cn.edu ...

  9. python 爬虫入门----案例爬取上海租房图片

    前言 对于一个net开发这爬虫真真的以前没有写过.这段时间学习python爬虫,今天周末无聊写了一段代码爬取上海租房图片,其实很简短就是利用爬虫的第三方库Requests与BeautifulSoup. ...

随机推荐

  1. Linux的线程同步对象:互斥量Mutex,读写锁,条件变量

        进程是Linux资源分配的对象,Linux会为进程分配虚拟内存(4G)和文件句柄等 资源,是一个静态的概念.线程是CPU调度的对象,是一个动态的概念.一个进程之中至少包含有一个或者多个线程.这 ...

  2. USACO3.32Shopping Offers(DP)

    五维DP,听着挺多的,貌似就是挺裸的dp, 最近貌似做简单的DP挺顺手..1A dp[i][j][e][o][g] = min(dp[i][j][e][o][g],dp[i-i1][j-i2][e-i ...

  3. AHOI2006文本编辑器editor

    1269: [AHOI2006]文本编辑器editor Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1885  Solved: 683[Submit ...

  4. 基于mongoDB的capped collection的性能优化

    MonitorLogging改造(消息接入) 改造前架构: 可以看出原来的流程中,大量业务分析,业务接入耦合在web服务层.大量操作,导致线程线性的挂起线程. 改造后: 将业务通讯抽象成为Monito ...

  5. 通过 Azure Media Encoder 降低编码成本

    John Deutscher  Azure 媒体服务首席项目经理 正如在我们的定价页面上宣布的那样,我们引入了一种只根据输出千兆字节数收取编码费用的全新定价模型.之前的/传统模型是根据输入和输出千兆字 ...

  6. JBPM4.4部署到tomcat6异常解决办法

    java.lang.LinkageError: loader constraint violation: when resolving interface method "javax.ser ...

  7. HDOJ/HDU 2352 Verdis Quo(罗马数字与10进制数的转换)

    Problem Description The Romans used letters from their Latin alphabet to represent each of the seven ...

  8. android 更新uI主线程

    http://www.cnblogs.com/wenjiang/p/3180324.html handleMessage 好用

  9. UVA 4728 Squares(凸包+旋转卡壳)

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=17267 [思路] 凸包+旋转卡壳 求出凸包,用旋转卡壳算出凸包的直 ...

  10. checkbox in iOs

    UIButton *checkbox; BOOL checkBoxSelected; checkbox = [[UIButton alloc] initWithFrame:CGRectMake(x,y ...