0
Q
在表單上繪製點
A
回答
4
這是一種方法。
Image bitmap = new Bitmap(100, 100); // sample image, load your real image from file here
using (var g = Graphics.FromImage(bitmap))
{
g.FillRectangle(Brushes.Red, new Rectangle(0, 0, bitmap.Width, bitmap.Height)); // Just to fill the background on the sample image, remove this
var transparentColor = Color.FromArgb(127, Color.Blue); // Create a semitransparent color
using(Brush brush = new SolidBrush(transparentColor))
{
// Create the dot
g.FillEllipse(brush, new Rectangle(10, 10, 25, 25));
// Create another dot
g.FillEllipse(brush, new Rectangle(25, 15, 25, 25));
}
}
myPictureBox.Image = bitmap; // display the image in an Imagebox (optional, you might use your image somewhere else)
相關問題
- 1. 在圖像上繪製點
- 2. 在QWidget上繪製QPixmap上的點(pyqt5)
- 3. 根據節點對距離在圖表上繪製節點
- 4. 如何在之前繪製的MATLAB圖上繪製數據點?
- 5. 如何在舞臺上繪製RGBA點?
- 6. Api在地圖上繪製點
- 7. 如何在CGContext CGMutablePathRef上繪製頂點?
- 8. 在圖像上繪製鼠標點擊
- 9. 在柵格圖層上繪製XYZ點
- 10. 在美國地圖上繪製點
- 11. 在flex中的線圖上繪製點
- 12. 在matlab上繪製矩陣的點
- 13. 如何在左上角繪製原點?
- 14. 在Octave/Matlab上繪製點圖像
- 15. 繪製在python matplotlib上plot_surface的頂級單三維點
- 16. 在iPhone上繪製點的最簡單方法是什麼?
- 17. 在SDL中繪製點列表?
- 18. C#表單繪製問題
- 19. 單擊 - 在地圖上繪製MKPolyline
- 20. 可在簡單按鈕上繪製
- 21. 如何在小圖上用很多點繪製圖表
- 22. 如何繪製MPAndroid圖表中的單個點(或ios圖表)
- 23. 在表格單元格內繪製
- 24. 在運行時繼續繪製表單
- 25. 在繪製位圖上繪製文本
- 26. 上繪製在PictureBox
- 27. 在VideoView上繪製
- 28. 在surfaceView上繪製
- 29. 在ImageView上繪製
- 30. 如何在圖表上繪製線條?
這件事情很好.. bt你能告訴我它究竟是如何創建透明效果?是它的聲明「color.fromargb」。也如果我想不使用任何位圖有沒有辦法? – olive 2011-03-11 05:41:16
@olive,yes ['FromArgb'](http://msdn.microsoft.com/en-us/library/system.drawing.color.fromargb.aspx)創建一個顏色,'127'是alpha值(透明度通道)。還有其他重載用於從'a,r,g,b'單獨創建顏色,請參閱所有重載的鏈接。 – 2011-03-11 07:32:40
@olive,你可以使用任何其他圖像,而不是位圖,我用'位圖'類型更新了我的答案。 – 2011-03-11 07:33:48