5046311 和 14221235 之间的 Color.ToArgb 关系? [英] Color.ToArgb relation between 5046311 and 14221235?
问题描述
表单背景色是 14221235 ,但是当我将 colordialog 中的 customcolor 设置为等于表单背景色时,它将其设置为 5046311 !!!有什么问题?
the form backcolor is 14221235 , but when i set the customcolor in colordialog to equal the form backcolor, it sets it to 5046311 !!! what is the problem?
这是我获得背景颜色的方式:
this is how i am getting the background color:
get_background = Str(Abs(Form1.BackColor.ToArgb))
我把它变成一个字符串的原因是因为我会把它输入一个包含 "32498239, 234234234, 23423234, 32234432432, 423324234" 的字符串
the reason i am turning it into a string is because i will feed it into a string which has "32498239, 234234234, 23423234, 32234432432, 423324234"
然后我把这个字符串放在像这样的自定义颜色中.顺便说一句,这段代码工作正常:
then i take this string and put it in customcolors like this. btw this piece of code works fine:
Dim numberStrings = My.Settings.mytext1.Split(","c).Select(Function(x) x.Trim())
ColorDialog1.CustomColors = numberStrings.Select(Function(x) CInt(x)).ToArray()
下面的一位用户提到 toargb 考虑了不透明度.这确实是一个很好的观点,我想澄清一下,我不需要不透明度.我将如何在不考虑不透明度的情况下执行 toargb?
a user below mentioned that toargb takes into account the opacity. this is an excellent point indeed, and i want to clarify that i DO NOT need the opacity. how would i do toargb without taking into opacity?
推荐答案
这就是你想要的
Microsoft.VisualBasic.RGB(Me.BackColor.R, Me.BackColor.G, Me.BackColor.B).ToString
这篇关于5046311 和 14221235 之间的 Color.ToArgb 关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!