C# 簡(jiǎn)易圖像處理(包括平移迄埃,旋轉(zhuǎn)男杈,翻轉(zhuǎn), 裁切)

控件布局 主要分為一個(gè)Panel + 一個(gè)PictureBox + 還有一個(gè)自定義半透明裁切平面ExtendedPanel调俘;

Form1.Designer.cs代碼如下:

namespace ImageEditer

{

partial class ImageEdit

{

///

/// 必需的設(shè)計(jì)器變量伶棒。

///

private System.ComponentModel.IContainer components = null;

///

/// 清理所有正在使用的資源。

///

/// 如果應(yīng)釋放托管資源彩库,為 true肤无;否則為 false。

protected override void Dispose(bool disposing)

{

if (disposing && (components != null))

{

components.Dispose();

}

base.Dispose(disposing);

}

#region Windows 窗體設(shè)計(jì)器生成的代碼

///

/// 設(shè)計(jì)器支持所需的方法 - 不要修改

/// 使用代碼編輯器修改此方法的內(nèi)容骇钦。

///

private void InitializeComponent()

{

this.splitContainer = new System.Windows.Forms.SplitContainer();

this.imageList = new System.Windows.Forms.Panel();

this.imageContainer = new System.Windows.Forms.Panel();

this.optPanel = new System.Windows.Forms.Panel();

this.reset = new System.Windows.Forms.Button();

this.rota180 = new System.Windows.Forms.Button();

this.rotaLeft = new System.Windows.Forms.Button();

this.rota90 = new System.Windows.Forms.Button();

this.roatRight = new System.Windows.Forms.Button();

this.vertical = new System.Windows.Forms.Button();

this.clip = new System.Windows.Forms.Button();

this.mirror = new System.Windows.Forms.Button();

this.ImageBox = new System.Windows.Forms.Panel();

this.pictureBox = new System.Windows.Forms.PictureBox();

this.textImport = new System.Windows.Forms.Button();

this.exportImage = new System.Windows.Forms.Button();

this.clipPanel = new ImageEditer.ExtendedPanel();

((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();

this.splitContainer.Panel1.SuspendLayout();

this.splitContainer.Panel2.SuspendLayout();

this.splitContainer.SuspendLayout();

this.imageContainer.SuspendLayout();

this.optPanel.SuspendLayout();

this.ImageBox.SuspendLayout();

((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();

this.SuspendLayout();

//

// splitContainer

//

this.splitContainer.BackColor = System.Drawing.Color.Transparent;

this.splitContainer.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;

this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;

this.splitContainer.Location = new System.Drawing.Point(0, 0);

this.splitContainer.Margin = new System.Windows.Forms.Padding(0);

this.splitContainer.Name = "splitContainer";

//

// splitContainer.Panel1

//

this.splitContainer.Panel1.Controls.Add(this.imageList);

//

// splitContainer.Panel2

//

this.splitContainer.Panel2.Controls.Add(this.imageContainer);

this.splitContainer.Panel2MinSize = 100;

this.splitContainer.Size = new System.Drawing.Size(961, 480);

this.splitContainer.SplitterDistance = 236;

this.splitContainer.SplitterWidth = 6;

this.splitContainer.TabIndex = 0;

//

// imageList

//

this.imageList.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)

| System.Windows.Forms.AnchorStyles.Left)

| System.Windows.Forms.AnchorStyles.Right)));

this.imageList.Location = new System.Drawing.Point(0, 0);

this.imageList.Name = "imageList";

this.imageList.Size = new System.Drawing.Size(232, 476);

this.imageList.TabIndex = 1;

//

// imageContainer

//

this.imageContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)

| System.Windows.Forms.AnchorStyles.Left)

| System.Windows.Forms.AnchorStyles.Right)));

this.imageContainer.AutoScroll = true;

this.imageContainer.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(128)))), ((int)(((byte)(128)))), ((int)(((byte)(255)))));

this.imageContainer.Controls.Add(this.optPanel);

this.imageContainer.Controls.Add(this.ImageBox);

this.imageContainer.ForeColor = System.Drawing.SystemColors.ControlText;

this.imageContainer.Location = new System.Drawing.Point(0, 0);

this.imageContainer.Name = "imageContainer";

this.imageContainer.Size = new System.Drawing.Size(717, 476);

this.imageContainer.TabIndex = 0;

//

// optPanel

//

this.optPanel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)

| System.Windows.Forms.AnchorStyles.Right)));

this.optPanel.BackColor = System.Drawing.Color.Gray;

this.optPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;

this.optPanel.Controls.Add(this.exportImage);

this.optPanel.Controls.Add(this.textImport);

this.optPanel.Controls.Add(this.reset);

this.optPanel.Controls.Add(this.rota180);

this.optPanel.Controls.Add(this.rotaLeft);

this.optPanel.Controls.Add(this.rota90);

this.optPanel.Controls.Add(this.roatRight);

this.optPanel.Controls.Add(this.vertical);

this.optPanel.Controls.Add(this.clip);

this.optPanel.Controls.Add(this.mirror);

this.optPanel.Location = new System.Drawing.Point(0, 0);

this.optPanel.Name = "optPanel";

this.optPanel.Size = new System.Drawing.Size(718, 26);

this.optPanel.TabIndex = 2;

//

// reset

//

this.reset.Location = new System.Drawing.Point(1, 0);

this.reset.Name = "reset";

this.reset.Size = new System.Drawing.Size(60, 23);

this.reset.TabIndex = 3;

this.reset.Text = "復(fù)位";

this.reset.UseVisualStyleBackColor = true;

//

// rota180

//

this.rota180.Location = new System.Drawing.Point(412, 0);

this.rota180.Name = "rota180";

this.rota180.Size = new System.Drawing.Size(72, 23);

this.rota180.TabIndex = 9;

this.rota180.Text = "旋轉(zhuǎn)180°";

this.rota180.UseVisualStyleBackColor = true;

//

// rotaLeft

//

this.rotaLeft.Location = new System.Drawing.Point(64, 0);

this.rotaLeft.Name = "rotaLeft";

this.rotaLeft.Size = new System.Drawing.Size(60, 23);

this.rotaLeft.TabIndex = 1;

this.rotaLeft.Text = "左旋";

this.rotaLeft.UseVisualStyleBackColor = true;

//

// rota90

//

this.rota90.Location = new System.Drawing.Point(346, 0);

this.rota90.Name = "rota90";

this.rota90.Size = new System.Drawing.Size(63, 23);

this.rota90.TabIndex = 8;

this.rota90.Text = "旋轉(zhuǎn)90°";

this.rota90.UseVisualStyleBackColor = true;

//

// roatRight

//

this.roatRight.Location = new System.Drawing.Point(127, 0);

this.roatRight.Name = "roatRight";

this.roatRight.Size = new System.Drawing.Size(60, 23);

this.roatRight.TabIndex = 2;

this.roatRight.Text = "右旋";

this.roatRight.UseVisualStyleBackColor = true;

//

// vertical

//

this.vertical.Location = new System.Drawing.Point(268, 0);

this.vertical.Name = "vertical";

this.vertical.Size = new System.Drawing.Size(75, 23);

this.vertical.TabIndex = 7;

this.vertical.Text = "垂直翻轉(zhuǎn)";

this.vertical.UseVisualStyleBackColor = true;

//

// clip

//

this.clip.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;

this.clip.Location = new System.Drawing.Point(487, 0);

this.clip.Name = "clip";

this.clip.Size = new System.Drawing.Size(68, 23);

this.clip.TabIndex = 4;

this.clip.Text = "裁切圖像";

this.clip.UseVisualStyleBackColor = true;

//

// mirror

//

this.mirror.Location = new System.Drawing.Point(190, 0);

this.mirror.Name = "mirror";

this.mirror.Size = new System.Drawing.Size(75, 23);

this.mirror.TabIndex = 6;

this.mirror.Text = "水平翻轉(zhuǎn)";

this.mirror.UseVisualStyleBackColor = true;

//

// ImageBox

//

this.ImageBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)

| System.Windows.Forms.AnchorStyles.Left)

| System.Windows.Forms.AnchorStyles.Right)));

this.ImageBox.AutoScroll = true;

this.ImageBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));

this.ImageBox.Controls.Add(this.clipPanel);

this.ImageBox.Controls.Add(this.pictureBox);

this.ImageBox.Location = new System.Drawing.Point(0, 23);

this.ImageBox.Name = "ImageBox";

this.ImageBox.Size = new System.Drawing.Size(718, 455);

this.ImageBox.TabIndex = 5;

//

// pictureBox

//

this.pictureBox.BackColor = System.Drawing.Color.Transparent;

this.pictureBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;

this.pictureBox.Location = new System.Drawing.Point(3, 6);

this.pictureBox.Margin = new System.Windows.Forms.Padding(0);

this.pictureBox.Name = "pictureBox";

this.pictureBox.Size = new System.Drawing.Size(32, 33);

this.pictureBox.TabIndex = 0;

this.pictureBox.TabStop = false;

//

// textImport

//

this.textImport.Location = new System.Drawing.Point(558, 0);

this.textImport.Name = "textImport";

this.textImport.Size = new System.Drawing.Size(72, 23);

this.textImport.TabIndex = 10;

this.textImport.Text = "插入文字";

this.textImport.UseVisualStyleBackColor = true;

//

// exportImage

//

this.exportImage.Location = new System.Drawing.Point(633, 0);

this.exportImage.Name = "exportImage";

this.exportImage.Size = new System.Drawing.Size(70, 23);

this.exportImage.TabIndex = 11;

this.exportImage.Text = "導(dǎo)出圖像";

this.exportImage.UseVisualStyleBackColor = true;

//

// clipPanel

//

this.clipPanel.BackColor = System.Drawing.Color.Transparent;

this.clipPanel.Location = new System.Drawing.Point(80, 9);

this.clipPanel.Name = "clipPanel";

this.clipPanel.Size = new System.Drawing.Size(27, 30);

this.clipPanel.TabIndex = 1;

//

// ImageEdit

//

this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;

this.ClientSize = new System.Drawing.Size(961, 480);

this.Controls.Add(this.splitContainer);

this.Name = "ImageEdit";

this.Text = "圖像";

this.SizeChanged += new System.EventHandler(this.ImageEdit_ResizeBegin);

this.splitContainer.Panel1.ResumeLayout(false);

this.splitContainer.Panel2.ResumeLayout(false);

((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();

this.splitContainer.ResumeLayout(false);

this.imageContainer.ResumeLayout(false);

this.optPanel.ResumeLayout(false);

this.ImageBox.ResumeLayout(false);

((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();

this.ResumeLayout(false);

}

#endregion

private System.Windows.Forms.SplitContainer splitContainer;

private System.Windows.Forms.Panel imageContainer;

private System.Windows.Forms.Button rotaLeft;

private System.Windows.Forms.Button roatRight;

private System.Windows.Forms.Button reset;

private System.Windows.Forms.Button clip;

private System.Windows.Forms.Panel ImageBox;

private System.Windows.Forms.Panel imageList;

private System.Windows.Forms.PictureBox pictureBox;

private ExtendedPanel clipPanel;

private System.Windows.Forms.Button vertical;

private System.Windows.Forms.Button mirror;

private System.Windows.Forms.Button rota90;

private System.Windows.Forms.Button rota180;

private System.Windows.Forms.Panel optPanel;

private System.Windows.Forms.Button textImport;

private System.Windows.Forms.Button exportImage;

}

}

自定義半透明裁切平面ExtendedPanel代碼如下:

usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespaceImageEditer{? ? internal classExtendedPanel : Panel? ? {? ? ? ? private const int WS_EX_TRANSPARENT = 0x20;? ? ? ? publicExtendedPanel()? ? ? ? {? ? ? ? ? ? SetStyle(ControlStyles.Opaque, true);? ? ? ? }? ? ? ? private int opacity = 50;? ? ? ? [DefaultValue(50)]? ? ? ? public intOpacity? ? ? ? {? ? ? ? ? ? get{? ? ? ? ? ? ? ? return this.opacity;? ? ? ? ? ? }? ? ? ? ? ? set{? ? ? ? ? ? ? ? if (value < 0 || value > 100)? ? ? ? ? ? ? ? ? ? throw new ArgumentException("value must be between 0 and 100");? ? ? ? ? ? ? ? this.opacity =value;? ? ? ? ? ? }? ? ? ? }? ? ? ? protected overrideCreateParams CreateParams? ? ? ? {? ? ? ? ? ? get{? ? ? ? ? ? ? ? CreateParams cp = base.CreateParams;? ? ? ? ? ? ? ? cp.ExStyle = cp.ExStyle |WS_EX_TRANSPARENT;? ? ? ? ? ? ? ? returncp;? ? ? ? ? ? }? ? ? ? }? ? ? ? protected override voidOnPaint(PaintEventArgs e)? ? ? ? {? ? ? ? ? ? using (var brush = new SolidBrush(Color.FromArgb(this.opacity * 255 / 100, this.BackColor)))? ? ? ? ? ? {? ? ? ? ? ? ? ? e.Graphics.FillRectangle(brush, this.ClientRectangle);? ? ? ? ? ? ? ? e.Graphics.DrawRectangle(new Pen(Color.Red, 2), this.ClientRectangle);? ? ? ? ? ? }? ? ? ? ? ? base.OnPaint(e);

? ? ? ? }

? ? }

}

圖片的縮放宛渐、平移操作PictureBox,圖片的旋轉(zhuǎn),鏡像主要操作?PictureBox里的Image眯搭,圖片的裁切主要通過(guò)操作自定義的ExtendedPanel大小來(lái)計(jì)算裁切后的尺寸及位置窥翩,通過(guò)轉(zhuǎn)換計(jì)算PictureBox里的Image真實(shí)裁切尺寸。

主代碼如下:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Diagnostics;

using System.Drawing;

using System.IO;

using System.Linq;

using System.Security.Policy;

using System.Text;

using System.Threading;

using System.Threading.Tasks;

using System.Windows.Forms;

using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;

namespace ImageEditer

{

public partial class ImageEdit : Form

{

private static int rotaNum = 0; // 旋轉(zhuǎn)角度

private static float zoomNum = 1.0f; // 縮放比例 未使用

private static int pointRadis = 12; // 裁切點(diǎn)大小

private static Boolean clipMode = false; // 是否開啟裁切

private static Boolean textMode = false; // 是否開啟標(biāo)注

private static Pen rotaPen = new Pen(Color.Blue, 10); // 旋轉(zhuǎn)顏色 未使用

private static Pen clipPen = new Pen(Color.Red, 10); // 裁切顏色

private static string imagePath = null; // 圖像路徑

private static Image sourceImage = null; // 初始輸入圖像源

private static Image outputImage = null; // 初始輸出圖像源 未使用

private static PictureBox currentPictureBox = null; // 當(dāng)前圖像容器

private static Panel currentImageBox = null; // 當(dāng)前圖像panel

private static Panel currentClipPanel = null; // 裁切平面

private static TextBox currentTextBox = null; // 文字輸入框

private static Point one = new Point(0, 0); // 裁切調(diào)整坐標(biāo)1

private static Point two = new Point(0, 0); // 裁切調(diào)整坐標(biāo)2

private static Point three = new Point(0, 0); // 裁切調(diào)整坐標(biāo)3

private static Point four = new Point(0, 0); // 裁切調(diào)整坐標(biāo)4

private static PictureBox OneButton = new PictureBox(); // 裁切調(diào)整點(diǎn)1

private static PictureBox TwoButton = new PictureBox(); // 裁切調(diào)整點(diǎn)2

private static PictureBox ThreeButton = new PictureBox(); // 裁切調(diào)整點(diǎn)3

private static PictureBox FourButton = new PictureBox(); // 裁切調(diào)整點(diǎn)4

private static System.Drawing.Rectangle clipRect = new System.Drawing.Rectangle(0, 0, 0, 0); // 裁切矩形信息

public Point mouseDownPoint; // 記錄鼠標(biāo)點(diǎn)擊坐標(biāo)

public bool isSelected = false; // 是否點(diǎn)擊圖像

public bool isClicked = false; // 是否點(diǎn)擊裁切矩形

public bool isClickedOne = false; // 是否點(diǎn)解裁切矩形調(diào)整點(diǎn)1

public bool isClickedTwo = false; // 是否點(diǎn)解裁切矩形調(diào)整點(diǎn)2

public bool isClickedThree = false; // 是否點(diǎn)解裁切矩形調(diào)整點(diǎn)3

public bool isClickedFour = false; // 是否點(diǎn)解裁切矩形調(diào)整點(diǎn)4

public ImageEdit(){

InitializeComponent();

imagePath = @"D:\1.jpg";

this.init(this.ImageBox, this.pictureBox, imagePath);

}

/**

* 初始化組件及事件

*/

public void init(Panel currentImage, PictureBox pictureBox, string path) {

imagePath = path.Trim();

sourceImage = Image.FromFile(path);

currentImageBox = currentImage;

/************************按鈕事件**************************/

this.reset.Click += new System.EventHandler(this.reset_Click);

this.rotaLeft.Click += new System.EventHandler(this.roatleft_Click);

this.roatRight.Click += new System.EventHandler(this.roatRight_Click);

this.rota90.Click += new System.EventHandler(this.roat90_Click);

this.rota180.Click += new System.EventHandler(this.roat180_Click);

this.mirror.Click += new System.EventHandler(this.mirror_Click);

this.vertical.Click += new System.EventHandler(this.vertical_Click);

this.clip.Click += new System.EventHandler(this.clip_Click);

this.textImport.Click += new System.EventHandler(this.import_Click);

this.exportImage.Click += new System.EventHandler(this.export_Click);

currentPictureBox = pictureBox;

currentPictureBox.Location = new Point(0, 0);

currentPictureBox.Width = 0;

currentPictureBox.Height = 0;

currentPictureBox.Image = sourceImage;

currentPictureBox.Width = sourceImage.Width;

currentPictureBox.Height = sourceImage.Height;

currentPictureBox.SizeMode = PictureBoxSizeMode.Zoom;

this.SizeChanged += new EventHandler(this.ImageEdit_ResizeBegin);

currentPictureBox.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.pictureBox_MouseWheel);

currentPictureBox.MouseDown += new System.Windows.Forms.MouseEventHandler(this.pictureBox_MouseDown);

currentPictureBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pictureBox_MouseMove);

currentPictureBox.MouseUp += new System.Windows.Forms.MouseEventHandler(this.pictureBox_MouseUp);

/************************裁切框組件**************************/

OneButton.Size = new Size(pointRadis, pointRadis);

TwoButton.Size = new Size(pointRadis, pointRadis);

ThreeButton.Size = new Size(pointRadis, pointRadis);

FourButton.Size = new Size(pointRadis, pointRadis);

OneButton.BackColor = Color.Red;

TwoButton.BackColor = Color.Red;

ThreeButton.BackColor = Color.Red;

FourButton.BackColor = Color.Red;

OneButton.Visible = clipMode;

TwoButton.Visible = clipMode;

ThreeButton.Visible = clipMode;

FourButton.Visible = clipMode;

FourButton.TabIndex = 10000;

currentImageBox.Controls.Add(OneButton);

currentImageBox.Controls.Add(TwoButton);

currentImageBox.Controls.Add(ThreeButton);

currentImageBox.Controls.Add(FourButton);

currentImageBox.Controls.Add(pictureBox);

currentClipPanel = this.clipPanel;

currentClipPanel.BackColor = Color.Transparent;

currentClipPanel.Visible = false;

currentClipPanel.Location = new Point(0, 0);

currentClipPanel.Width = 0;

currentClipPanel.Height = 0;

currentClipPanel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.clip_MouseDown);

currentClipPanel.MouseMove += new System.Windows.Forms.MouseEventHandler(this.clip_MouseMove);

currentClipPanel.MouseUp += new System.Windows.Forms.MouseEventHandler(this.clip_MouseUp);

OneButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.One_MouseDown);

OneButton.MouseMove += new System.Windows.Forms.MouseEventHandler(this.One_MouseMove);

OneButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.One_MouseUp);

TwoButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Two_MouseDown);

TwoButton.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Two_MouseMove);

TwoButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Two_MouseUp);

ThreeButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Three_MouseDown);

ThreeButton.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Three_MouseMove);

ThreeButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Three_MouseUp);

FourButton.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Four_MouseDown);

FourButton.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Four_MouseMove);

FourButton.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Four_MouseUp);

clipRect.X = 0;

clipRect.Y = 0;

clipRect.Width = currentPictureBox.Image.Width;

clipRect.Height = currentPictureBox.Image.Height;

resetImageToPanel();

}

/************************窗口事件**************************/

/**

* 窗口變化時(shí)候

*/

private void ImageEdit_ResizeBegin(object sender, EventArgs e)

{

resetImageToPanel();

}

/************************居中顯示**************************/

/**

* 縮放圖片到panel 居中

*/

private static void resetImageToPanel()

{

int windowWidth = currentImageBox.Width;

int windowHeight = currentImageBox.Height;

int imageWidth = clipRect.Width;

int imageHeight = clipRect.Height;

if (imageWidth >= imageHeight)

{

if (imageWidth > windowWidth)

{

double scaleHeight = (double)windowWidth / imageWidth * imageHeight;

currentPictureBox.Width = windowWidth;

currentPictureBox.Height = (int)scaleHeight;

}

else {

currentPictureBox.Width = imageWidth;

currentPictureBox.Height = imageHeight;

}

}

else

{

if (imageHeight > windowHeight)

{

double scaleWidth = (double)windowHeight / imageHeight * imageWidth;

currentPictureBox.Height = windowHeight;

currentPictureBox.Width = (int)scaleWidth;

}

else {

currentPictureBox.Width = imageWidth;

currentPictureBox.Height = imageHeight;

}

}

int X = (windowWidth - currentPictureBox.Width) / 2;

int Y = (windowHeight - currentPictureBox.Height) / 2;

currentPictureBox.Location = new Point(X, Y);

}

/************************按鈕事件**************************/

// 復(fù)位

private void reset_Click(object sender, EventArgs e)

{

rotaNum = 0;

resetImageToPanel();

}

// 左旋

private void roatleft_Click(object sender, EventArgs e)

{

currentPictureBox.Image = RotateImage(sourceImage, rotaNum -= 5);

}

// 右旋

private void roatRight_Click(object sender, EventArgs e)

{

currentPictureBox.Image = RotateImage(sourceImage, rotaNum += 5);

}

// 旋轉(zhuǎn)90度

private void roat90_Click(object sender, EventArgs e)

{

currentPictureBox.Image = RotateImage(sourceImage, rotaNum -= 90);

}

// 旋轉(zhuǎn)180度

private void roat180_Click(object sender, EventArgs e)

{

currentPictureBox.Image = RotateImage(sourceImage, rotaNum -= 180);

}

// 水平鏡像

private void mirror_Click(object sender, EventArgs e)

{

//currentPictureBox.Image = RotateImage(sourceImage, rotaNum);

currentPictureBox.Image = turnOverImage(currentPictureBox.Image, "mirror");

}

// 垂直鏡像

private void vertical_Click(object sender, EventArgs e)

{

//currentPictureBox.Image = RotateImage(sourceImage, rotaNum);

currentPictureBox.Image = turnOverImage(currentPictureBox.Image, "vertical");

}

// 裁切

private void clip_Click(object sender, EventArgs e)

{

clipMode = !clipMode;

if (textMode) {

textMode = false;

this.textImport.BackColor = Color.Transparent;

this.textImport.ForeColor = Color.Black;

}

if (clipMode)

{

this.clip.BackColor = Color.Blue;

this.clip.ForeColor = Color.White;

this.beginPainting();

}

else

{

this.clip.BackColor = Color.Transparent;

this.clip.ForeColor = Color.Black;

this.overPainting();

}

}

// 插入文字

private void import_Click(object sender, EventArgs e)

{

textMode = !textMode;

if (clipMode) {

this.clip.BackColor = Color.Transparent;

this.clip.ForeColor = Color.Black;

this.overPainting();

}

if (textMode)

{

this.textImport.BackColor = Color.Blue;

this.textImport.ForeColor = Color.White;

}

else

{

this.textImport.BackColor = Color.Transparent;

this.textImport.ForeColor = Color.Black;

}

}

// 導(dǎo)出圖像

private void export_Click(object sender, EventArgs e)

{

SaveFileDialog savedialog = new SaveFileDialog();

savedialog.Filter = "Png 圖片|*.png|Bmp 圖片|*.bmp|Gif 圖片|*.gif|Jpg 圖片|*.jpg|Wmf 圖片|*.wmf";

savedialog.FilterIndex = 0;

savedialog.RestoreDirectory = true; // 保存對(duì)話框是否記憶上次打開的目錄

savedialog.CheckPathExists = true; // 檢查目錄

savedialog.FileName = System.DateTime.Now.ToString("yyyyMMddHHmmss"); // 設(shè)置默認(rèn)文件名

if (savedialog.ShowDialog() == DialogResult.OK)

{

currentPictureBox.Image.Save(savedialog.FileName, System.Drawing.Imaging.ImageFormat.Png); // image為要保存的圖片

MessageBox.Show(this, "圖片保存成功鳞仙!", "信息提示");

}

}

/************************圖像鼠標(biāo)事件**************************/

private void pictureBox_MouseWheel(object sender, MouseEventArgs e)

{

if (currentPictureBox.ClientRectangle.Contains(e.Location))

{

((HandledMouseEventArgs)e).Handled = true;

currentPictureBox.Focus();

float zoomChange = e.Delta > 0 ? 2f : 0.5f;

// 計(jì)算縮放后圖片的大小

int newWidth = (int)(currentPictureBox.Width * zoomChange);

int newHeight = (int)(currentPictureBox.Height * zoomChange);

int newX = 0;

int newY = 0;

if (e.Delta > 0)

{

newX = (int)(currentPictureBox.Left - e.X);

newY = (int)(currentPictureBox.Top - e.Y);

}

else

{

newX = (int)(currentPictureBox.Left + e.X / 2);

newY = (int)(currentPictureBox.Top + e.Y / 2);

}

currentPictureBox.Size = new Size(newWidth, newHeight);

currentPictureBox.Location = new Point(newX, newY);

}

}

private void pictureBox_MouseDown(object sender, MouseEventArgs e)

{

if (e.Button == MouseButtons.Left)

{

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

if (textMode)

{

Cursor.Current = Cursors.Cross;

/*

TextBox textBox = new TextBox();

currentTextBox = textBox;

currentPictureBox.Controls.Add(textBox);

textBox.Location = new Point(mouseDownPoint.X, mouseDownPoint.Y);

textBox.Size = new Size(0, 0);*/

}

else {

Cursor.Current = Cursors.SizeAll;

isSelected = true;

}

}

}

private void pictureBox_MouseMove(object sender, MouseEventArgs e)

{

if (textMode) {

if (currentTextBox != null) {

// currentTextBox.Width = currentTextBox.Width + (Cursor.Position.X - mouseDownPoint.X);

// currentTextBox.Height = currentTextBox.Height + (Cursor.Position.Y - mouseDownPoint.Y);

}

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

}

else if (isSelected)

{

currentPictureBox.Left = currentPictureBox.Left + (Cursor.Position.X - mouseDownPoint.X);

currentPictureBox.Top = currentPictureBox.Top + (Cursor.Position.Y - mouseDownPoint.Y);

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

}

}

private void pictureBox_MouseUp(object sender, MouseEventArgs e)

{

isSelected = false;

// textMode = false;

}

/*************************裁切平面鼠標(biāo)事件*************************/

private void clip_MouseDown(object sender, MouseEventArgs e)

{

if (e.Button == MouseButtons.Left)

{

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

isClicked = true;

}

}

private void clip_MouseMove(object sender, MouseEventArgs e)

{

if (isClicked)

{

int dotaX = mouseDownPoint.X - Cursor.Position.X;

int dotaY = mouseDownPoint.Y - Cursor.Position.Y;

currentClipPanel.Left = currentClipPanel.Left - dotaX;

currentClipPanel.Top = currentClipPanel.Top - dotaY;

// 刷新第一寇蚊、二、三棍好、四個(gè)點(diǎn)位置

int newOneX = currentClipPanel.Location.X + currentClipPanel.Width / 2 - pointRadis / 2;

int newTwoY = currentClipPanel.Location.Y + currentClipPanel.Height / 2 - pointRadis / 2;

OneButton.Location = new Point(newOneX, currentClipPanel.Location.Y - pointRadis / 2);

ThreeButton.Location = new Point(newOneX, currentClipPanel.Location.Y + currentClipPanel.Height - pointRadis / 2);

TwoButton.Location = new Point(currentClipPanel.Location.X + currentClipPanel.Width - pointRadis / 2, newTwoY);

FourButton.Location = new Point(currentClipPanel.Location.X - pointRadis / 2, newTwoY);

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

}

}

private void clip_MouseUp(object sender, MouseEventArgs e)

{

isClicked = false;

}

/*************************第一個(gè)點(diǎn)鼠標(biāo)事件*************************/

private void One_MouseDown(object sender, MouseEventArgs e) {

if (e.Button == MouseButtons.Left)

{

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

Cursor.Current = Cursors.SizeNS;

isClickedOne = true;

}

}

private void One_MouseMove(object sender, MouseEventArgs e)

{

if (isClickedOne) {

int dotaY = mouseDownPoint.Y - Cursor.Position.Y;

if (ThreeButton.Location.Y - OneButton.Location.Y > 50 || dotaY > 0) {

// 計(jì)算高度和位置

currentClipPanel.Height = currentClipPanel.Height + dotaY;

int newY = currentClipPanel.Location.Y - dotaY;

currentClipPanel.Location = new Point(currentClipPanel.Location.X, newY);

int newPointY = OneButton.Location.Y - dotaY;

OneButton.Location = new Point(OneButton.Location.X, newPointY);

// 刷新第二仗岸、四個(gè)點(diǎn)位置

int newTwoY = currentClipPanel.Location.Y + currentClipPanel.Height / 2 - pointRadis / 2;

TwoButton.Location = new Point(TwoButton.Location.X, newTwoY);

FourButton.Location = new Point(FourButton.Location.X, newTwoY);

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

}

}

}

private void One_MouseUp(object sender, MouseEventArgs e)

{

isClickedOne = false;

}

/*************************第二個(gè)點(diǎn)鼠標(biāo)事件*************************/

private void Two_MouseDown(object sender, MouseEventArgs e)

{

if (e.Button == MouseButtons.Left)

{

Cursor.Current = Cursors.SizeWE;

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

isClickedTwo = true;

}

}

private void Two_MouseMove(object sender, MouseEventArgs e)

{

if (isClickedTwo)

{

int dotaX = mouseDownPoint.X - Cursor.Position.X;

if (TwoButton.Location.X - FourButton.Location.X > 50 || dotaX < 0) {

// 計(jì)算寬度和位置

currentClipPanel.Width -= dotaX;

int newPointX = TwoButton.Location.X - dotaX;

TwoButton.Location = new Point(newPointX, TwoButton.Location.Y);

// 刷新第一、三個(gè)點(diǎn)位置

int newOneX = currentClipPanel.Location.X + currentClipPanel.Width / 2 - pointRadis / 2;

OneButton.Location = new Point(newOneX, OneButton.Location.Y);

ThreeButton.Location = new Point(newOneX, ThreeButton.Location.Y);

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

}

}

}

private void Two_MouseUp(object sender, MouseEventArgs e)

{

isClickedTwo = false;

}

/*************************第三個(gè)點(diǎn)鼠標(biāo)事件*************************/

private void Three_MouseDown(object sender, MouseEventArgs e)

{

if (e.Button == MouseButtons.Left)

{

Cursor.Current = Cursors.SizeNS;

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

isClickedThree = true;

}

}

private void Three_MouseMove(object sender, MouseEventArgs e)

{

if (isClickedThree)

{

int dotaY = mouseDownPoint.Y - Cursor.Position.Y;

if (ThreeButton.Location.Y - OneButton.Location.Y > 50 || dotaY < 0)

{

// 計(jì)算高度和位置

currentClipPanel.Height = currentClipPanel.Height - dotaY;

int newPointY = ThreeButton.Location.Y - dotaY;

ThreeButton.Location = new Point(ThreeButton.Location.X, newPointY);

// 刷新第二借笙、四個(gè)點(diǎn)位置

int newTwoY = currentClipPanel.Location.Y + currentClipPanel.Height / 2 - pointRadis / 2;

TwoButton.Location = new Point(TwoButton.Location.X, newTwoY);

FourButton.Location = new Point(FourButton.Location.X, newTwoY);

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

}

}

}

private void Three_MouseUp(object sender, MouseEventArgs e)

{

isClickedThree = false;

}

/*************************第四個(gè)點(diǎn)鼠標(biāo)事件*************************/

private void Four_MouseDown(object sender, MouseEventArgs e)

{

if (e.Button == MouseButtons.Left)

{

Cursor.Current = Cursors.SizeWE;

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

isClickedFour = true;

}

}

private void Four_MouseMove(object sender, MouseEventArgs e)

{

if (isClickedFour)

{

// 計(jì)算寬度和位置

int dotaX = mouseDownPoint.X - Cursor.Position.X;

if (TwoButton.Location.X - FourButton.Location.X > 50 || dotaX > 0)

{

currentClipPanel.Width += dotaX;

int newX = currentClipPanel.Location.X - dotaX;

currentClipPanel.Location = new Point(newX, currentClipPanel.Location.Y);

int newPointX = FourButton.Location.X - dotaX;

FourButton.Location = new Point(newPointX, FourButton.Location.Y);

// 刷新第一扒怖、三個(gè)點(diǎn)位置

int newOneX = currentClipPanel.Location.X + currentClipPanel.Width / 2 - pointRadis / 2;

OneButton.Location = new Point(newOneX, OneButton.Location.Y);

ThreeButton.Location = new Point(newOneX, ThreeButton.Location.Y);

mouseDownPoint.X = Cursor.Position.X;

mouseDownPoint.Y = Cursor.Position.Y;

}

}

}

private void Four_MouseUp(object sender, MouseEventArgs e)

{

isClickedFour = false;

}

/***************************功能方法***********************/

/**

* 繪制裁切框

*/

private void beginPainting()

{

Debug.WriteLine("====beginPainting====");

OneButton.Visible = clipMode;

TwoButton.Visible = clipMode;

ThreeButton.Visible = clipMode;

FourButton.Visible = clipMode;

currentPictureBox.Image = RotateImage(sourceImage, rotaNum);

currentPictureBox.Refresh();

// 初始化位置

setDefaultClipButtonPosition();

currentClipPanel.Visible = clipMode;

}

/**

* 結(jié)束繪制

*/

private void overPainting()

{

Debug.WriteLine("====overPainting====");

OneButton.Visible = clipMode;

TwoButton.Visible = clipMode;

ThreeButton.Visible = clipMode;

FourButton.Visible = clipMode;

currentPictureBox.Image = RotateImage(sourceImage, rotaNum);

currentImageBox.Refresh();

// 裁切

clipBitmap();

currentClipPanel.Visible = clipMode;

}

/**

* 初始化裁切框調(diào)整按鈕到圖像尺寸

*/

private static void setDefaultClipButtonPosition()

{

int halfButton = pointRadis / 2 ;

// 設(shè)置拖拉按鈕

one.X = currentPictureBox.Location.X + currentPictureBox.Width / 2 - halfButton;

one.Y = currentPictureBox.Location.Y - halfButton;

OneButton.Location = one;

two.X = currentPictureBox.Location.X + currentPictureBox.Width - halfButton;

two.Y = currentPictureBox.Location.Y + currentPictureBox.Height / 2 - halfButton;

TwoButton.Location = two;

three.X = one.X;

three.Y = currentPictureBox.Location.Y + currentPictureBox.Height - halfButton;

ThreeButton.Location = three;

four.X = currentPictureBox.Location.X - halfButton;

four.Y = two.Y;

FourButton.Location = four;

currentClipPanel.Location = currentPictureBox.Location;

currentClipPanel.Width = currentPictureBox.Width;

currentClipPanel.Height = currentPictureBox.Height;

Graphics graphicsClip = OneButton.CreateGraphics();

graphicsClip.DrawRectangle(clipPen, clipRect);

graphicsClip.Dispose();

}

/**

* 裁切圖片

*/

private static void clipBitmap() {

Image srcImage = currentPictureBox.Image;

int X = currentClipPanel.Location.X - currentPictureBox.Location.X;

int Y = currentClipPanel.Location.Y - currentPictureBox.Location.Y;

int crossWidth = X < 0 ? currentClipPanel.Width + X: currentClipPanel.Width;

int crossHeight = Y < 0 ? currentClipPanel.Height + Y : currentClipPanel.Height;

int Width = crossWidth * srcImage.Width / currentPictureBox.Width;

int Height = crossHeight * srcImage.Height / currentPictureBox.Height;

X = X < 0 ? 0 : X * srcImage.Width / currentPictureBox.Width;

Y = Y < 0 ? 0 : Y * srcImage.Height / currentPictureBox.Height;

// 創(chuàng)建新圖位圖

Bitmap bitmap = new Bitmap(Width, Height);

bitmap.SetResolution(srcImage.HorizontalResolution, srcImage.VerticalResolution);

// 創(chuàng)建作圖區(qū)域

Graphics graphic = Graphics.FromImage(bitmap);

graphic.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;

graphic.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.Half;

// 截取原圖相應(yīng)區(qū)域?qū)懭胱鲌D區(qū)

Rectangle cRect = new Rectangle(X,Y, Width, Height);

graphic.DrawImage(srcImage, 0, 0, cRect, GraphicsUnit.Pixel);

graphic.Dispose();

/*Debug.WriteLine("SourceWidth===========>" + sourceImage.Width);

Debug.WriteLine("SourceHeight===========>" + sourceImage.Height);

Debug.WriteLine("Width===========>" + bitmap.Width);

Debug.WriteLine("Height===========>" + bitmap.Height);*/

//從作圖區(qū)生成新圖

// currentPictureBox.Image = Image.FromHbitmap( bitmap.GetHbitmap() );

/********刷新圖像*********/

currentPictureBox.Image = bitmap;

sourceImage = bitmap;

rotaNum = 0;

currentImageBox.Refresh();

clipRect.X = 0;

clipRect.Y = 0;

clipRect.Width = Width;

clipRect.Height = Height;

/********刷新圖像*********/

resetImageToPanel();

}

/**

* 旋轉(zhuǎn)圖像

*/

private static Bitmap RotateImage(Image image, float angle)

{

if (image == null)

{

throw new ArgumentNullException("image");

}

// 獲取中心點(diǎn)

float halfWidth = image.Width / 2.0f;

float halfHeight = image.Height / 2.0f;

// 弧度轉(zhuǎn)換

angle = angle % 360;

double radian = angle * Math.PI / 180.0;

double cos = Math.Cos(radian);

double sin = Math.Sin(radian);

int width = image.Width;

int height = image.Height;

// 計(jì)算旋轉(zhuǎn)后的圖像容器長(zhǎng)寬

int resultWidth = (int)(Math.Max(Math.Abs(width * cos - height * sin), Math.Abs(width * cos + height * sin)));

int resultHeight = (int)(Math.Max(Math.Abs(width * sin - height * cos), Math.Abs(width * sin + height * cos)));

float centerX = resultWidth / 2;

float centerY = resultHeight / 2;

// 設(shè)置新的圖像容器

Bitmap newImage = new Bitmap(resultWidth, resultHeight);

newImage.SetResolution(image.HorizontalResolution, image.VerticalResolution);

Graphics graphics = Graphics.FromImage(newImage);

// 平移圖像到中心點(diǎn)

graphics.TranslateTransform(centerX, centerY);

// 旋轉(zhuǎn)

graphics.RotateTransform(angle);

// 再次平移回來(lái)

graphics.TranslateTransform(-centerX, -centerY);

// 將圖片繪制到中心點(diǎn)上

float resultX = centerX - halfWidth;

float resultY = centerY - halfHeight;

graphics.DrawImage(image, new PointF(resultX, resultY));

graphics.Dispose();

clipRect.X = 0;

clipRect.Y = 0;

clipRect.Width = resultWidth;

clipRect.Height = resultHeight;

resetImageToPanel();

// 如果是裁切將顯示裁切框

/*if (clipMode)

{

Graphics graphicsClip = Graphics.FromImage(newImage);

graphicsClip.DrawRectangle(rotaPen, clipRect);

graphicsClip.Dispose();

}*/

/*Graphics graphicsClip = Graphics.FromImage(newImage);

graphicsClip.DrawRectangle(rotaPen, clipRect);

graphicsClip.Dispose();*/

return newImage;

}

/**

* 水平鏡像

*/

private static Image turnOverImage(Image image, string mode) {

Graphics g = Graphics.FromImage(image);

Rectangle rect = new Rectangle(0, 0, currentPictureBox.Image.Width, currentPictureBox.Image.Height);

switch (mode) {

case "mirror":

image.RotateFlip(RotateFlipType.RotateNoneFlipX);

break;

case "vertical":

image.RotateFlip(RotateFlipType.RotateNoneFlipY);

break;

}

g.DrawImage(image, rect);

g.Dispose();

return image;

}

}

}

目前只實(shí)現(xiàn)了這些,效率和內(nèi)存方面還沒有進(jìn)行測(cè)試业稼,計(jì)劃添加文字標(biāo)注和圖片導(dǎo)出功能盗痒。

代碼地址:https://github.com/suojianwen95/ImageEditer.git

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市低散,隨后出現(xiàn)的幾起案子俯邓,更是在濱河造成了極大的恐慌,老刑警劉巖谦纱,帶你破解...
    沈念sama閱讀 217,509評(píng)論 6 504
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件看成,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡跨嘉,警方通過(guò)查閱死者的電腦和手機(jī)川慌,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,806評(píng)論 3 394
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)祠乃,“玉大人梦重,你說(shuō)我怎么就攤上這事×链桑” “怎么了琴拧?”我有些...
    開封第一講書人閱讀 163,875評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)嘱支。 經(jīng)常有香客問我蚓胸,道長(zhǎng)挣饥,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 58,441評(píng)論 1 293
  • 正文 為了忘掉前任沛膳,我火速辦了婚禮扔枫,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘锹安。我一直安慰自己短荐,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,488評(píng)論 6 392
  • 文/花漫 我一把揭開白布叹哭。 她就那樣靜靜地躺著忍宋,像睡著了一般。 火紅的嫁衣襯著肌膚如雪风罩。 梳的紋絲不亂的頭發(fā)上糠排,一...
    開封第一講書人閱讀 51,365評(píng)論 1 302
  • 那天,我揣著相機(jī)與錄音泊交,去河邊找鬼乳讥。 笑死,一個(gè)胖子當(dāng)著我的面吹牛廓俭,可吹牛的內(nèi)容都是我干的云石。 我是一名探鬼主播,決...
    沈念sama閱讀 40,190評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼研乒,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼汹忠!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起雹熬,我...
    開封第一講書人閱讀 39,062評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤宽菜,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后竿报,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體铅乡,經(jīng)...
    沈念sama閱讀 45,500評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,706評(píng)論 3 335
  • 正文 我和宋清朗相戀三年烈菌,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了阵幸。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,834評(píng)論 1 347
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡芽世,死狀恐怖挚赊,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情济瓢,我是刑警寧澤荠割,帶...
    沈念sama閱讀 35,559評(píng)論 5 345
  • 正文 年R本政府宣布,位于F島的核電站旺矾,受9級(jí)特大地震影響蔑鹦,放射性物質(zhì)發(fā)生泄漏夺克。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,167評(píng)論 3 328
  • 文/蒙蒙 一举反、第九天 我趴在偏房一處隱蔽的房頂上張望懊直。 院中可真熱鬧,春花似錦火鼻、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,779評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至盼铁,卻和暖如春粗蔚,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背饶火。 一陣腳步聲響...
    開封第一講書人閱讀 32,912評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工鹏控, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人肤寝。 一個(gè)月前我還...
    沈念sama閱讀 47,958評(píng)論 2 370
  • 正文 我出身青樓当辐,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親鲤看。 傳聞我的和親對(duì)象是個(gè)殘疾皇子缘揪,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,779評(píng)論 2 354

推薦閱讀更多精彩內(nèi)容