首页 文章 精选 留言 我的

精选列表

搜索[PDF查看器],共4919篇文章
优秀的个人博客,低调大师

Swiper 轮播查看器

版权声明:本文首发 http://asing1elife.com ,转载请注明出处。 https://blog.csdn.net/asing1elife/article/details/82892947 Swiper 可以实现类似于相册图片查看的功能 更多精彩 更多技术博客,请移步 asing1elife’s blog 官网 Swiper Swiper-中文 API Swiper-API 引入插件所需 css/js 文件 <link href="path/to/swiper.min.css" rel="stylesheet"> <script src="path/to/swiper.min.js" type="text/javascript"></script> <script src="path/to/jquery.js" type="text/javascript"></script> 编写插件所需的基本布局 swiper-pagination 、swiper-button-prev 、swiper-button-next 、swiper-scrollbar 都是可选的 <div class="swiper-container"> <!-- 轮播内容容器 --> <div class="swiper-wrapper"> <!-- 轮播内容 --> <div class="swiper-slide">Slide 1</div> <div class="swiper-slide">Slide 2</div> <div class="swiper-slide">Slide 3</div> ... </div> <!-- 分页点 --> <div class="swiper-pagination"></div> <!-- 切换按钮 --> <div class="swiper-button-prev"></div> <div class="swiper-button-next"></div> <!-- 滚动条 --> <div class="swiper-scrollbar"></div> </div> 调用初始化方法 var itemSwiper = f7.swiper(".swiper-container", { speed: 400, spaceBetween: 100, prevButton: $recruitContentPanel.find(".prev-btn"), nextButton: $recruitContentPanel.find(".next-btn") });

优秀的个人博客,低调大师

html查看器android

本文转自lzwxx 51CTO博客,原文链接: http://blog.51cto.com/13064681/1943486 1.android的API提供了访问网络的一个类HttpURLConnection 2.通过发送GET请求获取服务器返回的html代码 3.先看看布局文件,如下所示, <?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <EditTextandroid:id="@+id/et" android:layout_width="match_parent" android:layout_height="wrap_content"/> <Buttonandroid:onClick="get" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="获取源码"/> <ScrollViewandroid:layout_width="match_parent" android:layout_height="match_parent"> <TextViewandroid:id="@+id/tv" android:layout_width="match_parent" android:layout_height="match_parent" android:textColor="#00f" android:hint="源码显示"/> </ScrollView></LinearLayout> 布局样子: 4.下来是清单文件,记得连接网络要添加权限 5.1再看java代码,MainActivity的 packagecom.market.source;importandroid.app.Activity;importandroid.os.Bundle;importandroid.util.Log;importandroid.view.View;importandroid.widget.EditText;importandroid.widget.TextView;importjava.io.IOException;importjava.io.InputStream;importjava.net.HttpURLConnection;importjava.net.MalformedURLException;importjava.net.ProtocolException;importjava.net.URL;importjava.net.URLConnection;importbutterknife.BindView;importbutterknife.ButterKnife;publicclassMainActivityextendsActivity{ @BindView(R.id.et) EditTextet; @BindView(R.id.tv) TextViewtv; @OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.bind(this); }publicvoidget(Viewvew)throwsIOException{finalStringstr=et.getText().toString().trim();newThread(){ @Overridepublicvoidrun(){//1.请求地址url URLurl=null;try{ url=newURL(str);//2.获取对这个地址的连接 HttpURLConnectioncon=(HttpURLConnection)url.openConnection();//3.设置对这个地址的请求,GET请求 con.setRequestMethod("GET");//4.设置请求参数 con.setConnectTimeout(5000);//5.获取服务器的响应 intcode=con.getResponseCode();//6.根据响应吗,判断请求成功还是失败,200成功 if(code==200){//7.成功的话,服务器一流的形式返回数据 InputStreaminputStream=con.getInputStream();//8.这个流是字节流,需要我们转换为字符流才可以认识 finalStringinfo=StreamTool.StreamtoString(inputStream); Log.e("MainActivity",info); runOnUiThread(newRunnable(){ @Overridepublicvoidrun(){ tv.setText(info); } }); } }catch(MalformedURLExceptione){ e.printStackTrace(); }catch(ProtocolExceptione){ e.printStackTrace(); }catch(IOExceptione){ e.printStackTrace(); } } }.start(); } } 5.2工具类,用来将一个流转化为字符串 publicclassStreamTool{publicstaticStringStreamtoString(InputStreaminputStream){intlen=-1;byte[]buffer=newbyte[1024];//内存数组输出流 ByteArrayOutputStreambaos=newByteArrayOutputStream();try{while((len=inputStream.read(buffer))!=-1){ baos.write(buffer,0,len); } Stringstr=newString(baos.toByteArray());returnstr; }catch(IOExceptione){ e.printStackTrace(); }finally{try{ inputStream.close(); }catch(IOExceptione){ e.printStackTrace(); } }returnnull; } } 6.运行效果查看

优秀的个人博客,低调大师

iOS开发-简单的图片查看器

现在你只要拿着手机,不管你Android还是iOS,新闻类的App不可避免都有一个功能就是图片查看,做个专题,查看一下内容,App Store中也有专门针对图片浏览的App,鉴于目前所知有限,无法做到那么高大上的App,简单的做个美女查看的Demo。没有太多的功能,上一张,下一张,标签,图片,简简单的,深刻的感觉到知识就是力量,目前知识有限的结果就是Demo简单,且学且珍惜吧。 1.新建项目(如果不会可以参考本人之前的文章),然后在StoryBoard中进行布局,将Girl文件夹中的图片拖入项目中; 2.将UIImageView,UILabel,UIButton拖入StoryBoard中,并且设置背景图片; 设置背景图片: 3.ViewController.h中定义成员变量: 1 2 3 4 5 6 7 8 9 10 #import <UIKit/UIKit.h> @interface ViewController : UIViewController @property (weak, nonatomic ) IBOutlet UIImageView *imageView; @property (weak, nonatomic ) IBOutlet UILabel *pageLabel; @end 4.上一张和下一张的事件代码: 定义一个图片数组: 1 2 3 4 5 6 7 8 9 10 11 @interface ViewController () @property NSArray *imageArr; @end @implementation ViewController - ( void )viewDidLoad { [ super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _imageArr=@[@ "girl0.jpg" ,@ "girl1.jpg" ,@ "girl2.jpg" ]; } 上一张的代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 //显示上一张 - ( IBAction )preview:( id )sender { NSInteger currentIndex=[[[_pageLabel text] substringToIndex:1] integerValue]; NSInteger allCount=[_imageArr count]; if (currentIndex==1) { currentIndex=allCount; } else { currentIndex=currentIndex-1; } //设置标签 [_pageLabel setText:[ NSString stringWithFormat:@ "%ld/%ld" ,currentIndex,( long )allCount]]; //获取图片的名称 NSString *imageName=[ NSString stringWithFormat:@ "girl%ld.jpg" ,( long )currentIndex-1]; UIImage *image=[UIImage imageNamed:imageName]; [_imageView setImage:image]; } 下一张代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 //显示下一张 - ( IBAction )nextView:( id )sender { //截取标签上面的数字 NSInteger currentIndex=[[[_pageLabel text] substringToIndex:1] integerValue]; NSInteger allCount=[_imageArr count]; if (currentIndex==allCount) { currentIndex=0; } NSString *imageName=[ NSString stringWithFormat:@ "girl%ld.jpg" ,( long )currentIndex]; [_pageLabel setText:[ NSString stringWithFormat:@ "%ld/%ld" ,currentIndex+1,( long )allCount]]; UIImage *image=[UIImage imageNamed:imageName]; [_imageView setImage:image]; } 以上的代码基本上都是OC基础,UIImage设置图片的时候只需要传递一下图片名称即可,不需要传递路径; 5.最终效果如下: 效果很简单,就是在上一张和下一张到临界点的时候判断一下,两者的代码类似,其实可以封装一下,周末愉快; ViewController.m中的代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 // // ViewController.m // MyPicture // // Created by keso on 15/1/17. // Copyright (c) 2015年 keso. All rights reserved. // #import "ViewController.h" @interface ViewController () @property NSArray *imageArr; @end @implementation ViewController - ( void )viewDidLoad { [ super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _imageArr=@[@ "girl0.jpg" ,@ "girl1.jpg" ,@ "girl2.jpg" ]; } - ( void )didReceiveMemoryWarning { [ super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } //显示上一张 - ( IBAction )preview:( id )sender { NSInteger currentIndex=[[[_pageLabel text] substringToIndex:1] integerValue]; NSInteger allCount=[_imageArr count]; if (currentIndex==1) { currentIndex=allCount; } else { currentIndex=currentIndex-1; } //设置标签 [_pageLabel setText:[ NSString stringWithFormat:@ "%ld/%ld" ,currentIndex,( long )allCount]]; //获取图片的名称 NSString *imageName=[ NSString stringWithFormat:@ "girl%ld.jpg" ,( long )currentIndex-1]; UIImage *image=[UIImage imageNamed:imageName]; [_imageView setImage:image]; } //显示下一张 - ( IBAction )nextView:( id )sender { //截取标签上面的数字 NSInteger currentIndex=[[[_pageLabel text] substringToIndex:1] integerValue]; NSInteger allCount=[_imageArr count]; if (currentIndex==allCount) { currentIndex=0; } NSString *imageName=[ NSString stringWithFormat:@ "girl%ld.jpg" ,( long )currentIndex]; [_pageLabel setText:[ NSString stringWithFormat:@ "%ld/%ld" ,currentIndex+1,( long )allCount]]; UIImage *image=[UIImage imageNamed:imageName]; [_imageView setImage:image]; } @end 本文转自Fly_Elephant博客园博客,原文链接:http://www.cnblogs.com/xiaofeixiang/p/4230348.html,如需转载请自行联系原作者

优秀的个人博客,低调大师

Android写的一个设置图片查看器,可以调整透明度

先来看看效果吧: main.xml代码如下: 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="fill_parent" 4 android:layout_height="fill_parent" 5 android:orientation="vertical" > 6 7 <LinearLayout 8 android:layout_width="match_parent" 9 android:layout_height="wrap_content" > 10 11 <Button 12 android:id="@+id/button1" 13 android:layout_width="wrap_content" 14 android:layout_height="wrap_content" 15 android:text="增大透明度" /> 16 17 <Button 18 android:id="@+id/button2" 19 android:layout_width="wrap_content" 20 android:layout_height="wrap_content" 21 android:text="减小透明度" /> 22 23 <Button 24 android:id="@+id/button3" 25 android:layout_width="wrap_content" 26 android:layout_height="wrap_content" 27 android:text="下一张" /> 28 </LinearLayout> 29 <!-- 定义显示整体图片的ImageView --> 30 31 <ImageView 32 android:id="@+id/imageView1" 33 android:layout_width="wrap_content" 34 android:layout_height="wrap_content" 35 android:background="#0000ff" 36 android:scaleType="fitCenter" 37 android:src="@drawable/shuangta" /> 38 <!-- 定义显示局部图片的ImageView --> 39 40 <ImageView 41 android:id="@+id/imageView2" 42 android:layout_width="wrap_content" 43 android:layout_height="wrap_content" 44 android:layout_marginTop="10dp" 45 android:background="#0000ff" /> 46 47 </LinearLayout> 其中java代码为: 1 package android.demo; 2 3 import android.app.Activity; 4 import android.graphics.Bitmap; 5 import android.graphics.BitmapFactory; 6 import android.graphics.drawable.BitmapDrawable; 7 import android.os.Bundle; 8 import android.view.MotionEvent; 9 import android.view.View; 10 import android.view.View.OnClickListener; 11 import android.view.View.OnTouchListener; 12 import android.widget.Button; 13 import android.widget.ImageView; 14 15 public class AndroidDemo5Activity extends Activity { 16 // 定义一个访问图片的数组 17 int[] images = new int[] { R.drawable.lijiang, R.drawable.qiao, 18 R.drawable.shuangta, R.drawable.shui, R.drawable.xiangbi, 19 R.drawable.ic_launcher, }; 20 // 定义当前显示的图片 21 int currentImage = 2; 22 // 定义图片的初始透明度 23 private int alpha = 255; 24 25 @Override 26 protected void onCreate(Bundle savedInstanceState) { 27 // TODO Auto-generated method stub 28 super.onCreate(savedInstanceState); 29 setContentView(R.layout.main); 30 final Button plusButton = (Button) findViewById(R.id.button1); 31 final Button minuxButton = (Button) findViewById(R.id.button2); 32 final Button nextButton = (Button) findViewById(R.id.button3); 33 34 final ImageView imageview1 = (ImageView) findViewById(R.id.imageView1); 35 final ImageView imageview2 = (ImageView) findViewById(R.id.imageView2); 36 37 // 定义查看下一张图片的时间监听器 38 nextButton.setOnClickListener(new OnClickListener() { 39 40 @Override 41 public void onClick(View v) { 42 if (currentImage >= 5) { 43 currentImage = -1; 44 } 45 BitmapDrawable bitmap = (BitmapDrawable) imageview1 46 .getDrawable(); 47 // 如果图片还没有回收,先强制回收图片 48 if (!bitmap.getBitmap().isRecycled()) { 49 bitmap.getBitmap().recycle(); 50 } 51 // 改变ImageView的图片 52 imageview1.setImageBitmap(BitmapFactory.decodeResource( 53 getResources(), images[++currentImage])); 54 } 55 }); 56 57 // 定义改变图片透明度的方法 58 OnClickListener listener = new OnClickListener() { 59 60 @Override 61 public void onClick(View v) { 62 if (v == plusButton) { 63 alpha += 20; 64 } 65 if (v == minuxButton) { 66 alpha -= 20; 67 } 68 if (alpha > 255) { 69 alpha = 255; 70 } 71 if (alpha <= 0) { 72 alpha = 0; 73 } 74 // 改变图片的透明度 75 imageview1.setAlpha(alpha); 76 77 } 78 }; 79 80 // 为2个按钮添加监听器 81 plusButton.setOnClickListener(listener); 82 minuxButton.setOnClickListener(listener); 83 imageview1.setOnTouchListener(new OnTouchListener() { 84 85 @Override 86 public boolean onTouch(View arg0, MotionEvent arg1) { 87 // TODO Auto-generated method stub 88 BitmapDrawable bitmapDeaw = (BitmapDrawable) imageview1 89 .getDrawable(); 90 // 获取第一个图片显示框中的位图 91 Bitmap bitmap = bitmapDeaw.getBitmap(); 92 double scale = bitmap.getWidth(); 93 // 或许需要显示图片的开始点 94 int x = (int) (arg1.getX() * scale); 95 int y = (int) (arg1.getY() * scale); 96 if (x + 120 > bitmap.getWidth()) { 97 x = bitmap.getWidth() - 120; 98 } 99 if (y + 120 > bitmap.getHeight()) { 100 y = bitmap.getHeight() - 120; 101 } 102 103 // 显示图片的指定区域 104 imageview2.setImageBitmap(Bitmap.createBitmap(bitmap, x, y, 105 120, 120)); 106 imageview2.setAlpha(alpha); 107 return false; 108 } 109 }); 110 } 111 112 } ============================================================================== 本文转自被遗忘的博客园博客,原文链接:http://www.cnblogs.com/rollenholt/archive/2012/05/17/2506331.html,如需转载请自行联系原作者

资源下载

更多资源
Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册