Jump to content
Xtreme .Net Talk

DR00ME

Avatar/Signature
  • Posts

    174
  • Joined

  • Last visited

Everything posted by DR00ME

  1. DR00ME

    Module

    How do I call module functions from e.g. form1 Private sub program ?
  2. I think I'm not gonna use that bloody API. Gonna make my own function which actually works properly = gives you proper Byte values. Thanks everyone who participated on this thread. btw. bri189a sometimes I want to do same as your avatar.
  3. sorry, sometimes I get too frustrated lol...
  4. R=252, G=254, B=214 converted to HSB is H=63, S=0,952381, B=0,9176471 'This is a fact I know (I got the values from the same pixel) (pixel.R pixel.G pixel.B) and (pixel.GetHue, pixel.GetSaturation, pixel.GetBrightness) B is sometimes called V (value) or L(luminance) I guess... anyway. Now here is my function and some code: Private Declare Function ColorHLSToRGB Lib "SHLWAPI.DLL" _ (ByVal wHue As Integer, ByVal wLuminance As Integer, ByVal wSaturation As Integer) As Long Dim nColor as Long Dim nRed,nGreen,nBlue as Integer nColor = ColorHLSToRGB(63, 0.9176471, 0.952381) nRed = nColor And 255 nGreen = (nColor / 256) And 255 nBlue = (nColor / 65536) And 255 Me.Text = CStr(nRed) + " " + CStr(nGreen) + " " + CStr(nBlue) Why it is giving me a wrong result(1 1 1) instead of (252 254 214) please help this is doing my head in.
  5. Hi, I'm using API- function: Private Declare Function ColorHLSToRGB Lib "SHLWAPI.DLL" _ (ByVal wHue As Integer, ByVal wLuminance As Integer, ByVal wSaturation As Integer) As Long How do I convert Long to RGB so I could take the R,G and B component out of it.
  6. usually when you read the code you can see it ? (lol) take it as: what do you mean exactly ? I use two monitors too... one for writing the code and the other one for properties, help etc.
  7. OMG: WINDOWS API Function "ColorHLSToRGB" from "Shlwapi.dll" I think Im gonna dance now tough it is 4:20 am....:D Private Declare Function ColorHLSToRGB Lib "SHLWAPI.DLL" _ (ByVal wHue As Integer, ByVal wLuminance As Integer, ByVal wSaturation As Integer) As Long How do I convert this Long to RGB ? I got some weird readings like 567345235234...erm HELP!
  8. Does Anyone know a better algorithm for changing HSV values to RGB ? Public Shared Sub ConvertHSBToRGB(h As Single, s As Single, v As Single, ByRef r As Single, ByRef g As Single, ByRef b As Single) If s = 0F Then ' if s = 0 then h is undefined r = v g = v b = v Else Dim hue As Single = System.Convert.ToSingle(h) If h = 360F Then hue = 0F End If hue /= 60F Dim i As Integer = Fix(Math.Floor(System.Convert.ToDouble(hue))) Dim f As Single = hue - i Dim p As Single = v *(1F - s) Dim q As Single = v *(1F - s * f) Dim t As Single = v *(1F - s *(1 - f)) Select Case i Case 0 r = v g = t b = p Case 1 r = q g = v b = p Case 2 r = p g = v b = t Case 3 r = p g = q b = v Case 4 r = t g = p b = v Case 5 r = v g = p b = q Case Else r = 0F g = 0F b = 0F 'Trace.Assert(false); ' hue out of range End Select End If End Sub 'ConvertHSBToRGB
  9. Nevermind. Thx everyone who tried. I don't need it anymore it is too heavy for CPU I found a way to go around it.
  10. ok there is a bug in my (actually not mine it is quoted from heiko) code so just forget it(I have also removed the code).... only thing im just trying to find out is how to calculate how many times a specific integer appears in some thing. This thing could be array,list,collection or something. I dont want to do 2 x for loops if I use an array to find out which int occur most. Does anyone know if there is a collection/list/something which contains a method for calculating occurance ?
  11. I think hashtable is not useful for my needs because it doesnt got a method to count how many times a specific key/value occurs in it or does it ?
  12. Dim R2 As NameValueCollection How do I add integer in R2 ?
  13. Problem solved, I had this Integer indexcounter overflowing.... thx anyway!
  14. I think it should work like that, could you tell me how you did it ? Is it 'Add reference' then browse and select user32.dll ? usually I use API functions like this: Private Declare Function DestroyWindow Lib "user32" (ByVal hndw As Integer) As Boolean first declare then use it.... I have never tried anything else so no help I guess.
  15. Dim R(76800) As Byte once I have inserted stuff in the array I clear it with: Array.Clear(R, 0, 76800) next time I try to put stuff in it -> indexOutOfRangeException. So am I clearing the array in a wrong way or what ? Help needed.
  16. I got 319.9.. anyway I think u r able to do it pretty easily... find the mouse click event handler... there should be a win API for it.... just try seaching google API mouse click or something
  17. you program the mouse cursor to move on the button and auto click it lol joking...
  18. DialogResult.Ok to somewhere I guess...
  19. But if you enter the right product key = application works = you know the right key. So what does it matter where or how you save it ? :) Program just tries to find a specific key from the specific location in winreg. If the key is wrong or missing = program whine. Am I missing a point or something but I dont know why you should crypt the key if you already know it (?)
  20. now it works like this: Dim MyArray() As String Dim MyString As String MyString = lstRGB.SelectedItem MyArray = MyString.Split(" "c) lblIndexSelect.BackColor = _ Color.FromArgb(CByte(MyArray(0)), CByte(MyArray(1)), CByte(MyArray(2))) is there any difference between CByte and Convert.ToByte ?
  21. lol thx guys
  22. lstRGB.Items.Add(CStr(pixelColor.R) + " " + CStr(pixelColor.G) + " " + CStr(pixelColor.B)) As you can see I have added 3 separate values in the listbox. Dim MyString As String MyString = lstRGB.SelectedItem lets say MyString is like "60 255 132" how do I split it in three parts ? one of them would be 60 second 255 and third 132... can you do it with split or substring ? it is 4am I can't think HELP! :)
  23. How about if the program tries to search the key from a specific location in windows registry.
  24. public sub function1 () code 1... if function2() then code2.... end if end sub public function function2 () as boolean if a>b then return true else return false end if end function something like this ? I just threw it...might got typos...
×
×
  • Create New...