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