- 博客(8)
- 资源 (12)
- 收藏
- 关注
原创 在winform 中PictureBox放大缩小图片
首先要将PictureBox中的SizeMode设置成StretchImage然后通过更改PictureBox中的宽度和高度来实现放大和缩小的功能//newRatio是放大缩小的倍数,缩小的话就是0.5之类的// currentImgBox此为pictureboxif (txtMulitiple.Text.Length <= 0 || null == currentImgBox.I
2012-01-15 09:31:09 9070 1
原创 C#获取图片中的颜色
Bitmap.GetPixel Method以下是msdn中的例子private void GetPixel_Example(PaintEventArgs e){ // Create a Bitmap object from an image file. Bitmap myBitmap = new Bitmap("Grapes.jpg"); // Get
2012-01-15 09:21:20 2807 1
原创 C#读取写入带有命名空间的XML文件
原xml文件样式 70 960 920 90000 1sdfsda 100 1 1 0 0 0 0 0 0 0 0 0 AllGb2312 SimpleScreenOCR Color
2012-01-10 17:09:23 1599 1
原创 根据窗体的Caption和Class获取窗体的句柄
private const Int32 MAX_WINDOW_TEXT = 1024; private const Int32 MAX_WINDOW_CLASS = 1024; private const UInt32 GW_HWNDNEXT = (UInt32)2; // private const UInt32 GW_HWNDFIRST = 0;
2012-02-03 16:45:33 1265
转载 C# 单问号(?)和双问号(??)的用法
1、单问号(?) 作用:用于给变量设初化的时候,给变量(int类型)赋为null值,而不是0。 例子: public int a; //默认值为0 public int ?b; //默认值为null参考:http://msdn.microsoft.com/zh-cn/library/1t3y8s4s.aspx
2012-02-03 11:32:32 571
转载 C# extern 用法介绍
extern 修饰符用于声明在外部实现的方法。extern 修饰符的常见用法是在使用 Interop 服务调入非托管代码时与 DllImport 属性一起使用。在这种情况下,还必须将方法声明为 static DllImport("avifil32.dll")] private static extern void AVIFileInit();也就是说这个方法是放在申明的类之外的类中实现 的
2012-01-20 17:08:19 546
原创 C#通过窗体句柄获取窗体的Caption
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "SendMessageW")] public static extern int SendMessageW2([System.Runtime.InteropServices.InAttribute()] System.IntP
2012-01-15 10:28:40 2886
原创 在winform中绘制矩形的方法
Graphics.DrawRectangle Method (Pen, Rectangle)msdn中 的例子public void DrawRectangleRectangle(PaintEventArgs e){ // Create pen. Pen blackPen = new Pen(Color.Black, 3); // Create rectang
2012-01-15 09:42:02 5611
学生公寓管理系统源码
2011-06-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人