WPF C#截图功能 仿qq截图
先上效果图
源码下载地址:http://download.csdn.net/detail/candyvoice/9788099
描述:启动程序,点击窗口button,开始截图,鼠标左键按下拖动,选中任意区域,拖动过程中,左上角实时显示选中区域大小,拖动结束,鼠标左键抬起,出现右下角保存、取消、ok三个button。右键点击,取消当前选中,可以继续拖动鼠标左键进行截图。双击右键,退出截图功能。按键盘ESC键,可退出截图。
原理:说的通俗一些,就是在原有的界面上盖上一层Canvas,就是画布,然后在这个画布上画矩形,也就是填充矩形的四周,空出来的地方就变成矩形了,如下图。边框线,线上可拖动的小方框、顶角可拖动的小圆球,都是自定义的样式,可在代码的generic.xaml文件中看到具体的设计。
参考资料:http://www.cnblogs.com/zhouyinhui/archive/2010/08/20/1804762.html
这个楼主原理的细节方面已经说的很详细,大家可以仔细看看。
根据上述楼主的代码,主要修改了以下两个类。
MaskCanvas.cs就是操作画布的类,MaskWindow.cs就是截图窗口的类。左上角大小显示框,是一label;右下角的三个按钮是一个自定义的toolbar。
1 MaskCanvas.cs
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
namespace RisCaptureLib
{
internal class MaskCanvas : Canvas
{
public delegate void FrameDrawEventHander(Rect rect);
public event FrameDrawEventHander OnMove;
public MaskCanvas()
{
Loaded += OnLoaded;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
//make the render effect same as SnapsToDevicePixels
//"SnapsToDevicePixels = true;" doesn't work on "OnRender"
//however, this maybe make some offset form the render target's origin location
//SetValue(RenderOptions.EdgeModeProperty, EdgeMode.Aliased);
//ini this
Cursor = BitmapCursor.CreateCrossCursor();
Background = Brushes.Transparent;
//ini mask rect
maskRectLeft.Fill = maskRectRight.Fill = maskRectTop.Fill = maskRectBottom.Fill = Config.MaskWindowBackground;
//these propeties(x, y...) will not changed
SetLeft(maskRectLeft, 0);
SetTop(maskRectLeft, 0);
SetRight(maskRectRight, 0);
SetTop(maskRectRight, 0);
SetTop(maskRectTop, 0);
SetBottom(maskRectBottom, 0);
maskRectLeft.Height = ActualHeight;
Children.Add(maskRectLeft);
Children.Add(maskRectRight);
Children.Add(maskRectTop);
Children.Add(maskRectBottom);
//ini selection border
selectionBorder.Stroke = Config.SelectionBorderBrush;
selectionBorder.StrokeThickness = Config.SelectionBorderThickness.Left;
Children.Add(selectionBorder);
//ini indicator
indicator = new IndicatorObject(this);
Children.Add(indicator);
CompositionTarget.Rendering += OnCompositionTargetRendering;
}
private void UpdateSelectionBorderLayout()
{
if (!selectionRegion.IsEmpty)
{
SetLeft(selectionBorder, selectionRegion.Left);
SetTop(selectionBorder, selectionRegion.Top);
selectionBorder.Width = selectionRegion.Width;
selectionBorder.Height = selectionRegion.Height;
}
}
private void UpdateMaskRectanglesLayout()
{
var actualHeight = ActualHeight;
var actualWidth = ActualWidth;
if (selectionRegion.IsEmpty)
{
SetLeft(maskRectLeft, 0);
SetTop(maskRectLeft, 0);
maskRectLeft.Width = actualWidth;
maskRectLeft.Height = actualHeight;
maskRectRight.Width = maskRectRight.Height = maskRectTop.Width = maskRectTop.Height = maskRectBottom.Width = maskRectBottom.Height = 0;
}
else
{
var temp = selectionRegion.Left;
if (maskRectLeft.Width != temp)
{
maskRectLeft.Width = temp < 0 ? 0 : temp; //Math.Max(0, selectionRegion.Left);
}
temp = ActualWidth - selectionRegion.Right;
if (maskRectRight.Width != temp)
{
maskRectRight.Width = temp < 0 ? 0 : temp; //Math.Max(0, ActualWidth - selectionRegion.Right);
}
if (maskRectRight.Height != actualHeight)
{
maskRectRight.Height = actualHeight;
}
SetLeft(maskRectTop, maskRectLeft.Width);
SetLeft(maskRectBottom, maskRectLeft.Width);
temp = actualWidth - maskRectLeft.Width - maskRectRight.Width;
if (maskRectTop.Width != temp)
{
maskRectTop.Width = temp < 0 ? 0 : temp; //Math.Max(0, ActualWidth - maskRectLeft.Width - maskRectRight.Width);
}
temp = selectionRegion.Top;
if (maskRectTop.Height != temp)
{
maskRectTop.Height = temp < 0 ? 0 : temp; //Math.Max(0, selectionRegion.Top);
}
maskRectBottom.Width = maskRectTop.Width;
temp = actualHeight - selectionRegion.Bottom;
if (maskRectBottom.Height != temp)
{
maskRectBottom.Height = temp < 0 ? 0 : temp; //Math.Max(0, ActualHeight - selectionRegion.Bottom);
}
}
}
#region Fileds & Props
private IndicatorObject indicator;
private Point? selectionStartPoint;
private Point? selectionEndPoint;
private Rect selectionRegion = Rect.Empty;
private bool isMaskDraging;
private readonly System.Windows.Shapes.Rectangle selectionBorder = new System.Windows.Shapes.Rectangle();
private readonly System.Windows.Shapes.Rectangle maskRectLeft = new System.Windows.Shapes.Rectangle();
private readonly System.Windows.Shapes.Rectangle maskRectRight = new System.Windows.Shapes.Rectangle();
private readonly System.Windows.Shapes.Rectangle maskRectTop = new System.Windows.Shapes.Rectangle();
private readonly System.Windows.Shapes.Rectangle maskRectBottom = new System.Windows.Shapes.Rectangle();
public Size? DefaultSize
{
get;
set;
}
public MaskWindow MaskWindowOwner
{
get;
set;
}
#endregion
#region Mouse Managment
private bool IsMouseOnThis(RoutedEventArgs e)
{
return e.Source.Equals(this) || e.Source.Equals(maskRectLeft) || e.Source.Equals(maskRectRight) || e.Source.Equals(maskRectTop) || e.Source.Equals(maskRectBottom);
}
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
{
if (selectionRegion != Rect.Empty)
return;
//mouse down on this self
if (IsMouseOnThis(e))
{
PrepareShowMask(Mouse.GetPosition(this));
}
//mouse down on indicator
else if (e.Source.Equals(indicator))
{
HandleIndicatorMouseDown(e);
}
base.OnMouseLeftButtonDown(e);
}
protected override void OnMouseMove(MouseEventArgs e)
{
if (IsMouseOnThis(e))
{
UpdateSelectionRegion(e, UpdateMaskType.ForMouseMoving);
e.Handled = true;
//委托调用
//Rect rec = OnMove();
if(OnMove != null)
{
if(selectionRegion !=null)
{
this.OnMove(selectionRegion);
}
}
}
base.OnMouseMove(e);
}
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
{
if (IsMouseOnThis(e))
{
UpdateSelectionRegion(e, UpdateMaskType.ForMouseLeftButtonUp);
FinishShowMask();
}
base.OnMouseLeftButtonUp(e);
}
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
{
indicator.Visibility = Visibility.Collapsed;
selectionRegion = Rect.Empty;
selectionBorder.Width = selectionBorder.Height = 0;
ClearSelectionData();
UpdateMaskRectanglesLayout();
base.OnMouseRightButtonUp(e);
}
internal void HandleIndicatorMouseDown(MouseButtonEventArgs e)
{
if(e.ClickCount>=2)
{
finishAction();
}
}
public void finishAction()
{
if (MaskWindowOwner != null)
{
MaskWindowOwner.ClipSnapshot(GetIndicatorRegion());
ClearSelectionData();
}
}
public System.Drawing.Bitmap GetSnapBitmap()
{
System.Drawing.Bitmap saveBitmap = null;
if (MaskWindowOwner != null)
{
Rect clipRegion = GetIndicatorRegion();
saveBitmap = MaskWindowOwner.CopyBitmapFromScreenSnapshot(clipRegion);
//close mask window
//Close();
//ClearSelectionData();
}
return saveBitmap;
}
private void PrepareShowMask(Point mouseLoc)
{
indicator.Visibility = Visibility.Collapsed;
selectionBorder.Visibility = Visibility.Visible;
selectionStartPoint = new Point?(mouseLoc);
if(!IsMouseCaptured)
{
CaptureMouse();
}
}
private void UpdateSelectionRegion(MouseEventArgs e, UpdateMaskType updateType)
{
if (updateType == UpdateMaskType.ForMouseMoving && e.LeftButton != MouseButtonState.Pressed)
{
selectionStartPoint = null;
}
if (selectionStartPoint.HasValue )
{
selectionEndPoint = e.GetPosition(this);
var startPoint = (Point) selectionEndPoint;
var endPoint = (Point) selectionStartPoint;
var sX = startPoint.X;
var sY = startPoint.Y;
var eX = endPoint.X;
var eY = endPoint.Y;
var deltaX = eX - sX;
var deltaY = eY - sY;
if (Math.Abs(deltaX) >= SystemParameters.MinimumHorizontalDragDistance ||
Math.Abs(deltaX) >= SystemParameters.MinimumVerticalDragDistance)
{
isMaskDraging = true;
double x = sX < eX ? sX : eX;//Math.Min(sX, eX);
double y = sY < eY ? sY : eY;//Math.Min(sY, eY);
double w = deltaX < 0 ? -deltaX : deltaX;//Math.Abs(deltaX);
double h = deltaY < 0 ? -deltaY : deltaY;//Math.Abs(deltaY);
selectionRegion = new Rect(x, y, w, h);
}
else
{
if (DefaultSize.HasValue && updateType == UpdateMaskType.ForMouseLeftButtonUp)
{
isMaskDraging = true;
selectionRegion = new Rect(startPoint.X, startPoint.Y, DefaultSize.Value.Width, DefaultSize.Value.Height);
}
else
{
isMaskDraging = false;
}
}
}
}
internal void UpdateSelectionRegion(Rect region)
{
selectionRegion = region;
}
public Rect GetSelectionRegion()
{
return selectionRegion;
}
private void FinishShowMask()
{
if (IsMouseCaptured)
{
ReleaseMouseCapture();
}
if (isMaskDraging)
{
if (MaskWindowOwner != null)
{
MaskWindowOwner.OnShowMaskFinished(selectionRegion);
}
UpdateIndicator(selectionRegion);
ClearSelectionData();
}
}
private void ClearSelectionData()
{
isMaskDraging = false;
selectionBorder.Visibility = Visibility.Collapsed;
selectionStartPoint = null;
selectionEndPoint = null;
}
private void UpdateIndicator(Rect region)
{
if(region.Width<indicator.MinWidth || region.Height<indicator.MinHeight)
{
return;
}
indicator.Width = region.Width;
indicator.Height = region.Height;
SetLeft(indicator, region.Left);
SetTop(indicator, region.Top);
indicator.Visibility = Visibility.Visible;
}
private Rect GetIndicatorRegion()
{
return new Rect(GetLeft(indicator), GetTop(indicator), indicator.ActualWidth, indicator.ActualHeight);
}
#endregion
#region Render
private void OnCompositionTargetRendering(object sender, EventArgs e)
{
UpdateSelectionBorderLayout();
UpdateMaskRectanglesLayout();
}
#endregion
#region inner types
private enum UpdateMaskType
{
ForMouseMoving,
ForMouseLeftButtonUp
}
#endregion
}
}
2 MaskWindow.cs
using System.Drawing;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Controls;
using System;
namespace RisCaptureLib
{
internal class MaskWindow : Window
{
private MaskCanvas innerCanvas;
private Bitmap screenSnapshot;
private Timer timeOutTimmer;
private readonly ScreenCaputre screenCaputreOwner;
//截图显示尺寸label
System.Windows.Controls.Label label = null;
//截图显示按键
ToolBarControl toolBarContrl = null;
//截图保存图片
private System.Drawing.Bitmap m_bmpLayerCurrent;
public MaskWindow(ScreenCaputre screenCaputreOwner)
{
this.screenCaputreOwner = screenCaputreOwner;
Ini();
innerCanvas.OnMove += DrawShowSize;
}
private void Ini()
{
//ini normal properties
//Topmost = true;
WindowStyle = WindowStyle.None;
ResizeMode = ResizeMode.NoResize;
ShowInTaskbar = false;
//set bounds to cover all screens
var rect = SystemInformation.VirtualScreen;
Left = rect.X;
Top = rect.Y;
Width = rect.Width;
Height = rect.Height;
//set background
screenSnapshot = HelperMethods.GetScreenSnapshot();
if (screenSnapshot != null)
{
var bmp = screenSnapshot.ToBitmapSource();
bmp.Freeze();
Background = new ImageBrush(bmp);
}
//ini canvas
innerCanvas = new MaskCanvas
{
MaskWindowOwner = this
};
Content = innerCanvas;
}
protected override void OnMouseDown(MouseButtonEventArgs e)
{
base.OnMouseDown(e);
//鼠标右键双击取消
if(e.RightButton == MouseButtonState.Pressed && e.ClickCount>=2)
{
CancelCaputre();
}
CreatLabel(e.GetPosition(innerCanvas));
label.Visibility = Visibility.Visible;
if (toolBarContrl != null)
{
toolBarContrl.Visibility = Visibility.Hidden;
}
}
protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
{
base.OnMouseMove(e);
if(timeOutTimmer != null && timeOutTimmer.Enabled)
{
timeOutTimmer.Stop();
timeOutTimmer.Start();
}
//设置左上角label和右下角toolbar鼠标跟随
Rect temRect = innerCanvas.GetSelectionRegion();
if(temRect == Rect.Empty)
{
return;
}
label.Content = "选中区域大小:" + temRect.Width + "×" + temRect.Height + "宽:" + temRect.Width + "高:" + temRect.Height;
if(label != null)
{
Canvas.SetLeft(label, temRect.X);
Canvas.SetTop(label, temRect.Y - 25);
}
if (toolBarContrl != null)
{
Canvas.SetLeft(toolBarContrl, temRect.X + temRect.Width - 75);
Canvas.SetTop(toolBarContrl, temRect.Y + temRect.Height);
}
}
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
{
base.OnMouseLeftButtonUp(e);
CreatToolBar(e.GetPosition(innerCanvas));
toolBarContrl.Visibility = Visibility.Visible;
}
//创建提示选中区域大小控件
private void CreatLabel(System.Windows.Point location)
{
if (label == null)
{
label = new System.Windows.Controls.Label();
innerCanvas.Children.Add(label);
}
label.Content = GetLabelContent();
label.Height = 25;
Canvas.SetLeft(label, location.X);
Canvas.SetTop(label, location.Y - 25);
}
private void CreatToolBar(System.Windows.Point location)
{
if (toolBarContrl == null)
{
toolBarContrl = new ToolBarControl();
innerCanvas.Children.Add(toolBarContrl);
Canvas.SetLeft(toolBarContrl, location.X - 75);
Canvas.SetTop(toolBarContrl, location.Y);
}
toolBarContrl.OnOK += OKAction;
toolBarContrl.OnCancel += CancelAction;
toolBarContrl.OnSaveCapture += SaveCaptureAction;
}
private string GetLabelContent()
{
string strContent = "";
return strContent;
}
protected override void OnKeyDown(System.Windows.Input.KeyEventArgs e)
{
base.OnKeyDown(e);
if(e.Key == Key.Escape)
{
CancelCaputre();
}
}
private void CancelCaputre()
{
Close();
screenCaputreOwner.OnScreenCaputreCancelled(null);
}
internal void OnShowMaskFinished(Rect maskRegion)
{
}
internal void ClipSnapshot(Rect clipRegion)
{
BitmapSource caputredBmp = CopyFromScreenSnapshot(clipRegion);
if (caputredBmp != null)
{
screenCaputreOwner.OnScreenCaputred(null, caputredBmp);
}
//close mask window
Close();
}
internal BitmapSource CopyFromScreenSnapshot(Rect region)
{
if (region.Width.Equals(0.0) || region.Height.Equals(0.0))
{
return null;
}
var sourceRect = region.ToRectangle();
var destRect = new Rectangle(0, 0, sourceRect.Width, sourceRect.Height);
if (screenSnapshot != null)
{
var bitmap = new Bitmap(sourceRect.Width, sourceRect.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
using (Graphics g = Graphics.FromImage(bitmap))
{
g.DrawImage(screenSnapshot, destRect, sourceRect, GraphicsUnit.Pixel);
}
return bitmap.ToBitmapSource();
}
return null;
}
private void SaveCaptureAction()
{
m_bmpLayerCurrent = innerCanvas.GetSnapBitmap();
if(m_bmpLayerCurrent == null)
{
return;
}
System.Windows.Forms.SaveFileDialog saveDlg = new System.Windows.Forms.SaveFileDialog();
string mydocPath = System.Environment.GetFolderPath(Environment.SpecialFolder.MyPictures);
saveDlg.InitialDirectory = mydocPath/* + "\\"*/;
saveDlg.Filter = "Bitmap(*.bmp)|*.bmp|JPEG(*.jpg)|*.jpg";
saveDlg.FilterIndex = 2;
saveDlg.FileName = "SView截图";
if (saveDlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
switch (saveDlg.FilterIndex)
{
case 1:
m_bmpLayerCurrent.Clone(new System.Drawing.Rectangle(0, 0, m_bmpLayerCurrent.Width, m_bmpLayerCurrent.Height),
System.Drawing.Imaging.PixelFormat.Format24bppRgb).Save(saveDlg.FileName,
System.Drawing.Imaging.ImageFormat.Bmp);
break;
case 2:
m_bmpLayerCurrent.Save(saveDlg.FileName,
System.Drawing.Imaging.ImageFormat.Jpeg);
break;
}
}
}
internal System.Drawing.Bitmap CopyBitmapFromScreenSnapshot(Rect region)
{
if(region.Width.Equals(0.0) || region.Height.Equals(0.0))
{
return null;
}
var sourceRect = region.ToRectangle();
var destRect = new Rectangle(0, 0, sourceRect.Width, sourceRect.Height);
if (screenSnapshot != null)
{
var bitmap = new Bitmap(sourceRect.Width, sourceRect.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
using (Graphics g = Graphics.FromImage(bitmap))
{
g.DrawImage(screenSnapshot, destRect, sourceRect, GraphicsUnit.Pixel);
}
return bitmap;
}
return null;
}
public void Show(int timeOutSecond, System.Windows.Size? defaultSize)
{
if (timeOutSecond > 0)
{
if (timeOutTimmer == null)
{
timeOutTimmer = new Timer();
timeOutTimmer.Tick += OnTimeOutTimmerTick;
}
timeOutTimmer.Interval = timeOutSecond*1000;
timeOutTimmer.Start();
}
if(innerCanvas != null)
{
innerCanvas.DefaultSize = defaultSize;
}
Show();
Focus();
}
private void OnTimeOutTimmerTick(object sender, System.EventArgs e)
{
timeOutTimmer.Stop();
CancelCaputre();
}
public void DrawShowSize(Rect rec)
{
if(rec == Rect.Empty)
{
return;
}
var wX = rec.Width;
var hY = rec.Height;
label.Content = "选中区域大小:" + wX + "×" + hY + "宽:" + wX + "高:" + hY;
}
public void OKAction()
{
innerCanvas.finishAction();
}
public void CancelAction()
{
CancelCaputre();
}
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
{
base.OnMouseRightButtonUp(e);
label.Visibility = Visibility.Hidden;
toolBarContrl.Visibility = Visibility.Hidden;
}
}
}
3 自定义toolbar
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace RisCaptureLib
{
/// <summary>
/// ToolBarControl.xaml 的交互逻辑
/// </summary>
public partial class ToolBarControl : UserControl
{
//确定事件
public delegate void OKEventHander();
public event OKEventHander OnOK;
//取消事件
public delegate void CancelEventHander();
public event CancelEventHander OnCancel;
//保存事件
public delegate void SaveCaptureEventHander();
public event SaveCaptureEventHander OnSaveCapture;
public ToolBarControl()
{
InitializeComponent();
}
private void buttonSave_Click(object sender, RoutedEventArgs e)
{
if (OnSaveCapture!=null)
{
OnSaveCapture();
}
buttonComplete_Click(sender, e);
}
private void buttonCancel_Click(object sender, RoutedEventArgs e)
{
if (OnCancel != null)
{
OnCancel();
}
}
private void buttonComplete_Click(object sender, RoutedEventArgs e)
{
if (OnOK != null)
{
OnOK();
}
}
}
}
WPF C#截图功能 仿qq截图的更多相关文章
- 【转】Android仿QQ截图应用测试
使用过QQ的同学应该都用过QQ截图,Ctrl+Alt+A进入截图操作,通过拉伸,移动高亮区域的框体可以快速截取我们需要的图片.在android应用中,我们也经常需要截图操作,以下实现了一个类似QQ截图 ...
- WPF ”真正的“高仿QQ
时常可以在各种论坛 博客 看到 各种所谓的 高仿QQ. 说实话 越看越想笑呢.(PS:纯粹的 抨击 那些 不追求 UI 完美主义者) 例如: 本次模仿 采用 C# WPF XAML , 总 ...
- WPF实现截图(仿微信截图)
WPF开发者QQ群: 340500857 | 微信群 -> 进入公众号主页 加入组织 每日一笑 肚子疼,去厕所排便,结果什么都没拉出来.看着自己坐在马桶上痛苦又努力却一无所获的样子,仿佛看到了 ...
- Linux系统中的截图功能(类似QQ、微信、Snipaste截图功能)
作者亲笔测试Ubuntu16.04,18.04,deepin15.11桌面版本Linux内核系统. 安装: 1. 终端命令黑框 2. sudo apt-get install flameshot(体积 ...
- Ubuntu中类似QQ截图的截图工具并实现鼠标右键菜单截图
@ 目录 简介: 安装: 设置快捷键: 实现鼠标右键菜单截图: 简介: 在Windows中用惯了强大易用的QQ截图,会不习惯Ubuntu中的截图工具. 软件名为火焰截图,功能类似QQ截图,可以设置快捷 ...
- Chrome 已经原生支持截图功能,还可以给节点截图!
昨天 Chrome62 稳定版释出,除了常规修复各种安全问题外,还增加很多功能上的支持,比如说今天要介绍的强大的截图功能. 直接截图 打开开发者工具页面,选择左上角的元素选择按钮(Inspect) W ...
- mac qq截图功能失效后,如何重启截图功能?
在finder中打开应用程序目录,找到QQ,右键单击QQ,选择显示包内容,此时会打开一个文件夹. 进入以下路径Library/LoginItems然后双击ScreenCapture这个进程,截图功能即 ...
- 网页客服思路以及QQ截图粘贴到聊天框功能
功能: 1.客服需登录进入客服页面.用户无需登录,进入用户页面,直接获取sessionId作为id值. 2.用户进入页面并且发送消息时,客服才会获取到该用户,并在左侧列表显示. 3.点击用户名即可切换 ...
- WPF仿QQ聊天框表情文字混排实现
原文:WPF仿QQ聊天框表情文字混排实现 二话不说.先上图 图中分别有文件.文本+表情.纯文本的展示,对于同一个list不同的展示形式,很明显,应该用多个DataTemplate,那么也就需要Data ...
随机推荐
- 不用Visual Studio,5分钟轻松实现一张报表
常规的报表设计,如RDLC.水晶报表等,需要安装Visual Studio,通过VS提供的报表设计界面来设计报表,通过VS设计报表对.NET开发者而言非常方便,但是对于非开发人员,要安装4G的一个VS ...
- Linux 学习笔记之超详细基础linux命令 Part 10
Linux学习笔记之超详细基础linux命令 by:授客 QQ:1033553122 ---------------------------------接Part 9----------------- ...
- loadrunner 脚本开发-int型变量和字符串的相互转换
脚本开发-int型变量和字符串的相互转换 by:授客 QQ:1033553122 字符串转化为int型变量 Action2() { int j = 0; j = atoi("12345&qu ...
- Java并发编程(七)深入剖析ThreadLocal
一.对ThreadLocal的理解 ThreadLocal,很多地方叫做线程本地变量,也有些地方叫做线程本地存储,其实意思差不多.可能很多朋友都知道ThreadLocal为变量在每个线程中都创建了一个 ...
- 洗礼灵魂,修炼python(46)--巩固篇—如虎添翼的property
@property 在前面装饰器一章中,提过一句话,装饰器也可以用于类中,确实可以的,并且python的类也内置了一部分装饰器.并且在前两章的hasattr等四个内置方法中,也说过其用法很类似装饰器, ...
- 洗礼灵魂,修炼python(17)--跨平台操作三剑客—os,os.path.sys模块
os 1.作用: 因为客户基本都是使用不同的操作系统,在不同的系统下,要完成一个项目,那必须跨平台操作,而python本来就是一个跨平台的语言,而有了os模块,则不需要在意什么系统.并且os模块是用于 ...
- Head First Android --- Intent
How to create the intentYou create an intent that specifies an action using the following syntax:whe ...
- C语言四舍五入
//今天遇到了四舍五入的问题,这些问题如果不看别人的真的难想出这么巧妙的方法啊.努力积累,早日成为大佬. int i = (int)(a + 0.5) ////小数部分大于0.4,加上0.5就会超过整 ...
- MATLAB线性方程组的迭代求解法
MATLAB线性方程组的迭代求解法 作者:凯鲁嘎吉 - 博客园http://www.cnblogs.com/kailugaji/ 一.实验目的 1. 借助矩阵按模最大特征值,判断解方程组的Jacobi ...
- IO流(字节流,字符流,缓冲流)
一:IO流的分类(组织架构) 根据处理数据类型的不同分为:字节流和字符流 根据数据流向不同分为:输入流和输出流 这么庞大的体系里面,常用的就那么几个,我们把它们抽取出来,如下图: 二:字符字节 ...