GDI+: Why is FillRectangle transparent on glass, while FillEllipse is opaque?
来源:互联网 发布:淘宝网店购买 编辑:程序博客网 时间:2024/05/17 14:26
i'm drawing a rectangle, and an ellipse, on glass.
brush = new SolidBrush(0xFF000000); //solid (i.e. non-opaque) blackgraphics.FillRectangle(brush, x, y, 30, 30);graphics.FillEllipse(brush, x+33, y-15, 30, 30);
- drawing with ellipse: it's opaque
- drawing with rectangle: it's not opaque
What is going on here?
You can see the same also applies for other colors:
brush = new SolidBrush(0xFFff0000); //solid (i.e. non-opaque) redgraphics.FillRectangle(brush, x, y, 30, 30);graphics.FillEllipse(brush, x, y+33, 30, 30);brush = new SolidBrush(0xFF00ff00); //solid (i.e. non-opaque) greengraphics.FillRectangle(brush, x, y, 30, 30);graphics.FillEllipse(brush, x, y+33, 30, 30);brush = new SolidBrush(0xFF0000ff); //solid (i.e. non-opaque) bluegraphics.FillRectangle(brush, x, y, 30, 30);graphics.FillEllipse(brush, x, y+33, 30, 30);brush = new SolidBrush(0xFFffffff); //solid (i.e. non-opaque) whitegraphics.FillRectangle(brush, x, y, 30, 30);graphics.FillEllipse(brush, x, y+33, 30, 30);
Conclusion: Why does:
FillEllipse
with an opaque color draw opaqueFillRectangle
with an opaque color draws partially transparent
Note: This question is very nearly a duplicate of my other question. Except this question focuses on the difference between
FillRectangle
andFillEllipse
- whereas that question deals with *How to draw opaque colors on glass.
See also
- Aero: How to draw solid (opaque) colors on glass?
- Windows Aero: What color to paint to make “glass” appear?
转自:http://stackoverflow.com/questions/4286467/gdi-why-is-fillrectangle-transparent-on-glass-while-fillellipse-is-opaque
- GDI+: Why is FillRectangle transparent on glass, while FillEllipse is opaque?
- Process.start() is failed on run with special account...why?
- Why Ruby is Simple
- Why extends is evil
- Why is China angry?
- why is me?
- why gpDesc is NULL?
- WHY IS GREP
- Why LD_LIBRARY_PATH is bad
- Why cacheAsBitmap is bad!
- Why LD_LIBRARY_PATH is bad
- Why system() is evil
- Why is ++[[]][+[]]+[+[]] = “10”-
- Why is tracking difficult?
- Why singleton is bad?
- 【课堂提问】Why is Multithread?
- Why chaining constructors is bad.
- Why is Present so slow?
- win 7 64位 使用windows server2003 所共享的HP打印机
- Linux INITRAMFS 与 INITRD
- PHP 文件的锁定机制
- Java压缩html
- shell调用php脚本,并传递参数
- GDI+: Why is FillRectangle transparent on glass, while FillEllipse is opaque?
- Mongodb数据库(一)
- 简明 Python 教程
- 我的主页:LD日志 - www.lightdew.com
- android sdk更新导致adt错误
- 浏览器客户端与服务器的交互过程
- 有关JSON以及JSON在PHP中的应用
- linux下查找某个目录下所有文件中是否含有某个字符串-find命令
- 设计模式之策略模式