开发者

Highlighter Pen in c#

开发者 https://www.devze.com 2023-01-24 05:04 出处:网络
I want to make it so my pen can be a highlighter, so basically changing its opacity, but i don\'t know how to do this. I currently use a colordialog to allow the use to choose desired colour but this

I want to make it so my pen can be a highlighter, so basically changing its opacity, but i don't know how to do this. I currently use a colordialog to allow the use to choose desired colour but this only allows me have colours which aren't transparent enough to see through it like a highlighter tool on powerpoint as an example of the tool opacity. So any code to allow me to integrate the use of my colordialog with a opacity开发者_JS百科 to be able to see through it.

Thanks


Something like this:

Color baseColor = Color.Red;  // Or whatever, from the color picker
Color highlighter = Color.FromArgb(128, baseColor);

The first argument to FromArgb, is the 'alpha', or opacity, on a scale from 0 (completely transparent) to 255 (completely opaque), so 128 is 50%.


http://msdn.microsoft.com/en-us/library/system.windows.media.drawinggroup.opacity.aspx


Is this a WinForms app? Could you use the Tablet PC Pen and Ink facilities? (That MSDN page is for Windows XP Tablet Edition, but I think that the ink components are included in Vista and Windows 7)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号