心形圖案盒
回答
這似乎工作:從這裏
public class HeartPictureBox : PictureBox {
protected override void OnPaint(PaintEventArgs pe) {
using (System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath()) {
path.AddBezier(this.Width >> 1,
this.Height >> 2,
this.Width * 1.25f, 0f,
this.Width,
this.Height * 0.75f,
this.Width >> 1,
this.Height);
path.AddBezier(this.Width >> 1,
this.Height >> 2,
-this.Width * .25f, 0f,
0f,
this.Height * 0.75f,
this.Width >> 1,
this.Height);
this.Region = new Region(path);
}
}
}
貝塞爾東西:http://www.codeproject.com/Tips/177794/Heart-shaped-Form-in-C-2-0
非常感謝! –
爲什麼我有一個錯誤'System.Windows.Forms.Control.Region'是一個'屬性',但像'type'\t錯誤一樣使用? –
哦,我想通了:) –
using System;
namespace ConsoleApplication6
{
class Program
{
static void Main()
{
Console.WriteLine(" o o.o o ");
Console.WriteLine(" o o ");
Console.WriteLine(" o o ");
Console.WriteLine(" o o ");
Console.WriteLine(" o o ");
Console.WriteLine(" o ");
Console.ReadKey();
}
}}
不知道你打算如何將它顯示爲一個PictureBox控件。 – LarsTech
- 1. 沙盒核心WLAN?
- 2. Android有核心圖形,如目標C核心圖形?
- 3. 如何將我的圖標對準我的方形盒子的中心?
- 4. 用於尋路的圖形沙盒
- 5. 繪製在一個盒形圖
- 6. 兩種不同形式的圖像盒
- 7. 循環龜盒圖形命令
- 8. R中的多個柵格盒形圖
- 9. 使用ggplot2 CSV數據的盒形圖
- 10. 廣場爲環形圖案
- 11. 星形圖案邏輯
- 12. preg_match php,形成圖案
- 13. 遞歸星形圖案
- 14. 核心圖形混色
- 15. iPhone核心圖形動畫
- 16. 核心圖形座標系
- 17. 中心圖形內容
- 18. iphone中的核心圖形
- 19. 使用核心圖形
- 20. 核心圖形CGContextClip - Xcode
- 21. 學習核心圖形
- 22. 核心圖形繪製多個形狀
- 23. Firefox:中心彈性盒
- 24. 中心一個div盒
- 25. 使用CSS的定心盒
- 26. 如何通過核心圖或核心圖形繪製Ven圖?
- 27. 是否可以使用開關盒創建星形圖案或星形金字塔?
- 28. 檢測圖像中的圓形圖案
- 29. 從中心生成SVG圖案
- 30. 線條和條形圖在一個圖形核心圖
這是一個WPF /的WinForms/ASP/XNA問題?請用您使用的相關框架標記它:)如果您有任何問題,請發佈一些代碼。 – Codeman
'心形區域' - 用[bezier曲線](http://www.google.com/search?q=bezier+heart)製作一個。 – GSerg
它在一個winform,可悲的是,我沒有任何想法如何使心臟形狀, –