' InkHin_ZhiZhuo
' Date :2019.2.18
' E-mail lqx@tyningling.Top 'This function and Module is written because of the need to use Gdiplus.
' My English is limited. I hope youall don't laugh at me.
' The ARGB attribute obtained by inverse calculation.
' Em...... And... I love China.... emmm, yes, I like it very much.
' All right, Be is it. ' 装不下去了哈哈哈哈,本来想当一把外国友人过把瘾的。。 Option Explicit Public Type ARGB
Alpha As String
Red As String
Green As String
Blue As String
End Type Private ARGB_a As ARGB Public Sub IFunction_Name_A(Color As String) If ARGB_FormColor(Color, ARGB_a) Then With ARGB_a
MsgBox _
"A: " & .Alpha & " " & "Ten:" & Val("&H" & .Alpha) & vbCrLf _
& "R: " & .Red & " " & "Ten:" & Val("&H" & .Red) & vbCrLf _
& "G: " & .Green & " " & "Ten:" & Val("&H" & .Green) & vbCrLf _
& "B: " & .Blue & " " & "Ten:" & Val("&H" & .Blue), vbOKOnly, "InkHin_Yes"
End With Else
MsgBox "出现错误。", vbOKOnly, "InkHin_Error" End If
End Sub Public Sub IFunction_Name_B(ByRef ARGB_a As ARGB)
'ARGB from Attribute Computing
Dim Color As Long With ARGB_a
.Alpha =
.Green =
End With If ARGB_FormValue(ARGB_a, Color) Then MsgBox Color, vbOKOnly, "InkHin_Yes" Else MsgBox "出现错误。", vbOKOnly, "InkHin_Error" End If
End Sub Function ARGB_FormColor(ByVal ArgbColor As String, ByRef ARGB As ARGB) As Boolean ' ArgbColor belongs to decimal If Not IsNumeric(ArgbColor) Then Exit Function ' End Dim String_DecimalSystem As String ' var DecimalSystem String_DecimalSystem = Hex(CDbl(ArgbColor)) 'Coercive transformation 'Mid(string,start[,length]) With ARGB
.Alpha = Mid(String_DecimalSystem, , )
.Red = Mid(String_DecimalSystem, , )
.Green = Mid(String_DecimalSystem, , )
.Blue = Mid(String_DecimalSystem, , )
End With ARGB_FormColor = True
End Function Public Function ARGB_FormValue(ByRef ARGB As ARGB, ByRef Color As Long) As Boolean
'ARGB(alpha,red,green,blue) With ARGB If Val(.Alpha) > Or Val(.Red) > Or Val(.Green) > Or Val(.Blue) > Then Exit Function 'End If Val(.Alpha) < Or Val(.Red) < Or Val(.Green) < Or Val(.Blue) < Then Exit Function 'End Dim S_a As String, S_r As String, S_g As String, S_b As String, S_16 As String ' var add...... S_a = Hex(Val(.Alpha)): S_r = Hex(Val(.Red)): S_g = Hex(Val(.Green)): S_b = Hex(Val(.Blue)) 'Hex(var DecimalSystem = ) End With 'Because......十六进制ARGB is 两位为一个值的。
'if this 字数= 1 so 加0
' 完了,我自己都看不下去了 If Len(S_a) < Then S_a = "" & S_a
If Len(S_r) < Then S_r = "" & S_r
If Len(S_g) < Then S_g = "" & S_g
If Len(S_b) < Then S_b = "" & S_b S_16 = "&H" & S_a & S_r & S_g & S_b Color = Val(S_16) ARGB_FormValue = True
End Function

贴上第二份代码:

2019.7.11更新:

'by 方程&Error404
Public Function argb(ByVal a As byte, ByVal r As byte, ByVal g As byte, ByVal b As byte) As Long
Dim Color As Long
If a = And r = And g = And b = Then r =
CopyMemory ByVal VarPtr(Color) + , a,
CopyMemory ByVal VarPtr(Color) + , r,
CopyMemory ByVal VarPtr(Color) + , g,
CopyMemory ByVal VarPtr(Color), b,
argb = Color
End Function

GDI+_从Bitmap里得到的Color数组值解决方案的更多相关文章

  1. GDI+_从Bitmap里得到的Color数组值分解

    [这里写只是我个人的摸索经历,已经给出解决方案] 我之前写过一篇关于ARGB值的研究:https://www.cnblogs.com/lingqingxue/p/10362639.html 最近我又遇 ...

  2. Zookeeper_阅读源码第一步_在 IDE 里启动 zkServer(集群版)

    上篇文章Zookeeper_阅读源码第一步_在 IDE 里启动 zkServer(单机版)讲了在 idea 里以单机的方式启动zookeeper,这篇介绍一下以集群的方式启动. 集群方式启动,才会真正 ...

  3. React-高阶函数_函数柯里化

    高阶函数_函数柯里化 高阶函数(定义) 如果一个函数符合下面两个规范,就是高阶函数: 如果A函数,接收的参数是一个函数,那么A就是一个高阶函数(比如数组方法arr.map()接收的就是一个处理item ...

  4. PHP的数组值传入JavaScript的数组里

    <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html><head>       &l ...

  5. Python第七天 函数 函数参数 函数里的变量 函数返回值 多类型传值 函数递归调用 匿名函数 内置函数

    Python第七天   函数  函数参数   函数里的变量   函数返回值  多类型传值     函数递归调用   匿名函数   内置函数 目录 Pycharm使用技巧(转载) Python第一天   ...

  6. 对<tr><td>标签里的input 循环取值

    需求描述:单击table整行,跳转到具体的信息页面  关键就是获取整行的id,传给后台做查询,返回list 解决思路:用带参数函数传过去id,然后在js的函数中用$("#id"). ...

  7. php判断检测一个数组里有没有重复的值

    php判断检测一个数组里有没有重复的值 php里有一个处理数组重复值得函数array_unique,我们的思路就是用这个函数来实现的. if (count($array) != count(array ...

  8. GDI+_入门教程【一】

    GDI For VisualBasic6.0 [一]文件下载:GDI+ For VB6[一] 简单绘图实例演示百度网盘 1 '以下为作者[vIsiaswx]的教程 '(该教程发布的原地址已无法访问,此 ...

  9. 图片_ _优化Bitmap加载图片1

    ===========  1   视图显示大量图片时的内存问题 setBackgroundResource 回去res 资源文件里面找适配手机当前屏幕的文件,所以消耗高,etBackgroundDra ...

随机推荐

  1. 事件冒泡(event bubbling)与事件捕捉(event capturing)

    事件捕捉: 单击<div>元素就会以下列顺序触发click 事件. Document => Element html => Element body => Element ...

  2. 15.1 打开文件时的提示(不是dos格式)去掉头文件

    1.用ultraedit打开文件时,总提示不是DOS格式 2.把这个取消.dos格式只是用来在unix下读写内容的,此功能禁用即可.

  3. Excel文件上传,高亮错误的行和列

    /// <summary> /// Excel模板写入错误信息 /// </summary> /// <param name="fileName"&g ...

  4. 7.6.2 break 语句

    7.6.2 break 语句 程序执行到循环中的break语句时,会种植包含它的循环,并继续执行下一阶段. 如果break语句位于嵌套循环内,它只会影响包含它的当前循环. break还可用于因其他原因 ...

  5. 怎么精确控制solidworks里面的表格的位置

    手工移动是不可能的,总是有点误差,虽然有主动捕捉的功能. public void SetTablePosition(TableAnnotation table, double x, double y) ...

  6. JMeter4.0源码导入Eclipse记录

    参考: https://blog.csdn.net/yue530tomtom/article/details/77870233?locationNum=10&fps=1 1.准备jdk环境 下 ...

  7. 【转录组入门】3:了解fastq测序数据

    操作:需要用安装好的sratoolkit把sra文件转换为fastq格式的测序文件,并且用fastqc软件测试测序文件的质量 作业:理解测序reads,GC含量,质量值,接头,index,fastqc ...

  8. 学习MeteoInfo二次开发教程(九)

    最终的MaskOut功能未能实现 另外,一个有用的,在指定位置显示图片: legend.MarkerType = MarkerType.Image; legend.ImagePath = " ...

  9. AET PN结

    电场方向 电场方向和正电荷受力方向相同 飘移运动和扩散运动 多子和电场方向互相抵制,而多子是扩散运动,而对少子则是促进作用,当扩散和漂移达到动态平衡时,我们称PN结形成 PN结特性 单项导电性

  10. Android 开发 View的API 转载

    转载地址:https://blog.csdn.net/lemonrabbit1987/article/details/47704679 View类代表用户界面组件的基本构建块.一个View占据屏幕上的 ...