Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a paroblem with this function in RGBColor class:

 

Public Class RGBColor

 

Public Function getComplement(ByVal rgb As Integer()) As Integer()

'some code

End Function

 

End Class

 

-----------------------------------------------------------------

 

ByVal rgb As Integer() --> I guess this is an array...

 

How do I insert values in it when I call getComplement function.

I must provide this function with 3 integers (r, g, b)? How do I do this?

Please help me....

  • *Experts*
Posted

Dim colors(2) As Integer
colors(0) = 255 ' Red
colors(1) = 255 ' Green
colors(2) = 255 ' Blue

Dim ret() As Integer ' Return value
ret = RGBColor.getComplement(colors)

 

You could also define the getComplement function with three

separate parameters for the red, green, and blue values:

Public Function getComplement(ByVal red As Integer, ByVal green As Integer, ByVal blue As Integer) As Integer()
'some code
End Function

 

Also, because a color value can't be more than 255, it makes

sense to use a Byte type instead of Integer so that errors will be

raised if the value is out of range.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...