' 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. C 函数传参问题

    1. 传指针 传入指针时会改变指针指向的内容 2. 传变量 传入变量,不会改变变量的内容,只是使用变量的数据

  2. HTTP 客户端接收数据超时

    本文使用两种方式测试HTTP 客户端读数据超时的情况,一种是直接使用golang自带的http库,另一种是使用martini web框架. 1. 测试1--直接使用http库 1.1.启动server ...

  3. AllocateHWnd SetTimer API

    unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms ...

  4. CentOS7中KVM虚拟机内存、CPU调整

    CentOS7中KVM虚拟机内存.CPU调整 1. 调小虚拟机内存 调小虚拟机内存可以动态实现,不用关机 1.1 查看当前内存大小 [root@kvm01 ~]# virsh dominfo vm1- ...

  5. MicrosoftRootCertificateAuthority2011.cer 下载

    下载地址:https://files.cnblogs.com/files/hyh123/microsoft-root-certificate-authority.rar 在安装Microsoft .N ...

  6. 二维码(android)

    我们都知道一般的二微码都是以不同形式显示有的是登入,有的是网页,其实二维码只是一个字符串.到这里我们就有一个疑问那二维码是这样判断是网站或者是登入功能的呢? 其实这些判断部分,二维码生成器早就给你完成 ...

  7. rediscluster安装

    Redis 3.2.1集群搭建   一.概述 Redis3.0版本之后支持Cluster. 1.1.redis cluster的现状 目前redis支持的cluster特性: 1):节点自动发现 2) ...

  8. idea properties文件中文无法正常显示

    引用:https://blog.csdn.net/u010999809/article/details/81204457 问题:在idea打开配置文件,已经设置了全局编码格式为UTF-8,和项目编码格 ...

  9. 爬虫系列3:Requests+Xpath 爬取租房网站信息并保存本地

    数据保存本地 [抓取]:参考前文 爬虫系列1:https://www.cnblogs.com/yizhiamumu/p/9451093.html [分页]:参考前文 爬虫系列2:https://www ...

  10. 提问:MicrosoftUnderlying input stream returned zero bytes

    报错信息:MicrosoftUnderlying input stream returned zero bytes 报错截图: 查阅资料后,提示 jdbc的bug,不能将一个"NULL&qu ...