' 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. Python PIL 图像缩小、拼接

    比较各种不同取样方式的图像缩放效果. [NEAREST, BILINEAR, BICUBIC, LANCZOS, BOX, HAMMING]NEAREST取样方式是效果最差的,PIL.Image.re ...

  2. mycat 安装 分表 分库 读写分离

    简单的 理解 一下 mycat :如图 mycat 是一个 连接数据库的中介.一个独立安装的 工具,他连接着真实的数据库,并且 把自己伪装成一个数据库. 程序连接 mycat ,mycat 连接 到真 ...

  3. eclipse+gradle

    一.gradle 下载与安装 下载地址:http://services.gradle.org/distributions/ 下载后,放到:D:\gradle-4.6 在系统环境变量path,中加:D: ...

  4. Spring boot配置logback

    在application-dev.yml增加配置 配置文件的路径为 rescoures/evn/dev/logback-spring.xml <?xml version="1.0&qu ...

  5. Firebird Embedded 部署的一个坑

    今天把旧程序升级了,把DBX组件换成了FireDac组件,在虚拟机里测试的时候,一直报上图中的错误,但是在主机上运行无问题,之前用户使用也一直没报过这个错. 折腾了又折腾,还是搞不定,感觉脑袋有点大了 ...

  6. <python的线程与threading模块>

    <python的线程与threading模块> 一 线程的两种调用方式 threading 模块建立在thread 模块之上.thread模块以低级.原始的方式来处理和控制线程,而thre ...

  7. 新建服务器出现错误 Peer authentication failed for user "postgres" 的解决办法

    用pgadmin3 新建服务器出现错误 Peer authentication failed for user "postgres" 在stackoverflow上找到答案,出现此 ...

  8. 用openssl为EAP-TLS生成证书(CA证书,服务器证书,用户证书)

    用openssl为EAP-TLS生成证书(CA证书,服务器证书,用户证书) 来源: https://www.cnblogs.com/osnosn/p/10597897.html 来自osnosn的博客 ...

  9. Difference Between Git and SVN

    From: http://www.differencebetween.net/technology/software-technology/difference-between-git-and-svn ...

  10. [UE4]Grab抓取

    一.关键函数:AttachToCompoent,将要抓取的物品附加到角色手上,让物品跟随手移动,开起来就像是抓取在手里了. 二.取消模拟物理.在开启模拟物理的情况下,AttachToCompoent是 ...