' 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. Technical

    CAN FD (CAN with Flexible Data-Rate) is an extension to the original CAN bus protocol specified in I ...

  2. bond-vlan-bridge

    拓扑介绍 Eth-Trunk5 down down 0% 0% 0 0 10GE1/0/5 down down 0.01% 0.01% 0 0 10GE2/0/5 down down 0.01% 0% ...

  3. delphi 多线程之System.TMonitor

    三天不写代码就手生! 把测试代码记录下来. unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, S ...

  4. Asp.Net : Page.RegisterStartupScript及 不执行的原因

    RegisterStartupScript 把script放置在ASP.NET page的底部,而RegisterClientScriptBlock把script放置在ASP.NET page的顶部 ...

  5. js中使用showModelDialog中下载文件的时候,闪一下后无法下载

    在js中使用showModelDialog中下载文件的时候,会因为showModelDialog自动设置target为_self导致下载文件“只会闪一下”就消失掉 在吧target设置为_blank后 ...

  6. WebService之客户端

    创建项目 File→New→Other→Web Services→Web Service Client中输入从服务端得到的wsdl链接: http://localhost:8080/WS_WebSer ...

  7. Ruby版快速排序

    class Array def quick_sort return self if self.length<=1 k = self[0] head = 0 tail = self.length ...

  8. 【转】使用Eclipse,将鼠标放在相应方法或字段等元素上时,无法显示提示

    使用Eclipse编写java代码时,将鼠标放在相应方法或字段等元素上时,会有对应的说明或提示. 不过,常出现下面的问题: Note:An exception occurred while getti ...

  9. Lubuntu下小巧好用的Python编辑工具Geany

    在Lubuntu系统上有很多的Python编辑器,如eclipse,PyCharm等,功能繁多,市场占有率高,但动辄几百M的体积有些巨大,博主今天推荐一款精简且易用的Python开发工具--Geany ...

  10. centos7虚拟机克隆后设置固定IP

    虚拟机centos7克隆一份出来之后,新centos7更改了固定IP,可是不生效.重启网卡时报错: network.service: control process exited, code=exit ...