台灣最大程式設計社群網站
∣
免費加入會員
∣登入
∣回首頁∣
您好
線上人數
1110
會員總數:
246255
討論主題:
189807
討論區
程式下載/上傳
科技新聞
專欄文章
會員中心
加值服務
外包接案
求職求才
登入
登出
歡迎您
免費
加入會員
討論區選單
新手必讀
我要提問!!
討論區
個人討論區
我的關注主題
我的黑名單
討論區EP英雄榜
專家等級說明
討論區常見問題
兌換發問點數QP
扣點申請加值服務
申請版主
開發工具
ASP
ASP.NET
C#
VB.NET
VB6
C/C++
PHP
Java
Java Script/ Node.js
AJAX / JSON / jQuery
其他語言
行動裝置開發
Android APP 開發
iOS APP/ swift 開發
Windows Phone APP
資料庫
ACCESS
MS SQL
MySQL
Oracle
其他DB
多媒體 / 網管
CSS/HTML5/Bootstarp
影像處理
office VBA / WinOS
Windows 伺服器
Linux / Unix
網管 / 資安 / VM
硬體 / 週邊 / 其他
綜合
求職求才
外包接案
心情甘苦談
網站經營 / 合夥 / 證照
建言 / 公告
文章區
專欄文章
科技新聞
Blog精華文章
討論區列表
>>
C#
>> picturebox合併
[]
[
我要回覆
]
picturebox合併
價值 : 40 QP
點閱數:260 回應數:0
樓主
sichon
0
8
137
17
發送站內信
我建立了一個Class1,是PictureBox,可以在FORM內自由移動
我想在Class1可以控制大小,而且PictureBox和Class1(自由移動和控制大小下)合併儲存到桌面,應該怎樣做
using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication2 { public class Class1 : PictureBox { public Class1(IContainer container) { container.Add(this); } Point point; protected override void OnMouseDown(MouseEventArgs e) { point = e.Location; base.OnMouseDown(e); } protected override void OnMouseMove(MouseEventArgs e) { if (e.Button == MouseButtons.Left) { this.Left += e.X - point.X; this.Top += e.Y - point.Y; } base.OnMouseMove(e); } } }
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { pictureBox1.Load(openFileDialog1.FileName); } pictureBox1.Controls.Add(class12); pictureBox1.BackColor = Color.Transparent; } private void button2_Click(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Bitmap bmp = new Bitmap(pictureBox1.Image); bmp.Save(saveFileDialog1.FileName); } } } }
搜尋相關Tags的文章:
[ picturebox合併 ] ,
[ picturebox控制大小 ] ,
本篇文章發表於2021-01-18 11:37
目前尚無任何回覆
回覆
如要回應,請先
登入
.
|
網站導覽
|
網站介紹
|
4P點數說明
|
電子報
|
小舖活動
|
大事紀
|
廣告刊登
|
常見問題
|
聯絡我們
|
版權所有 ©copyright 2000 All Rights Reserved