Solved

Get the amount of red, green and blue from given 32 bit pixel value.

Posted on 2004-04-08
2
253 Views
Last Modified: 2010-05-02
HI!

Function RGB creates a color value based on given Red, Green and Blue values.

I need a function which will do the oposite:   extract amounts of Red, Green and Blue from color value created by GetPixel and RGB functions.

Thanks!
0
Comment
Question by:dbrckovi
2 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 250 total points
ID: 10782557
where color is RGB color

function GetRed(color)
      
On Error Resume Next
GetRed = color And &HFF
end Function

function GetGreen(color)
      
On Error Resume Next
GetGreen = ((color And &HFF00) / &H100) And &HFF
end Function

function GetBlue(color)
      
On Error Resume Next
GetBlue = ((color And &HFF0000) / &H10000) And &HFF
end Function
0
 
LVL 11

Author Comment

by:dbrckovi
ID: 10782582
Perfect.    Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now