Click here to Skip to main content
16,015,991 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Tumbnail algorithm Pin
Giorgi Dalakishvili14-Sep-07 1:35
mentorGiorgi Dalakishvili14-Sep-07 1:35 
Questionconversion color - hexnumber - color Pin
Tom Deketelaere13-Sep-07 0:28
professionalTom Deketelaere13-Sep-07 0:28 
AnswerRe: conversion color - hexnumber - color Pin
Luc Pattyn13-Sep-07 1:36
sitebuilderLuc Pattyn13-Sep-07 1:36 
GeneralRe: conversion color - hexnumber - color Pin
Tom Deketelaere13-Sep-07 1:43
professionalTom Deketelaere13-Sep-07 1:43 
GeneralRe: conversion color - hexnumber - color Pin
Luc Pattyn13-Sep-07 2:00
sitebuilderLuc Pattyn13-Sep-07 2:00 
GeneralRe: conversion color - hexnumber - color Pin
Tom Deketelaere13-Sep-07 2:13
professionalTom Deketelaere13-Sep-07 2:13 
GeneralRe: conversion color - hexnumber - color Pin
Luc Pattyn13-Sep-07 2:36
sitebuilderLuc Pattyn13-Sep-07 2:36 
GeneralRe: conversion color - hexnumber - color Pin
Tom Deketelaere13-Sep-07 3:08
professionalTom Deketelaere13-Sep-07 3:08 
somehow that doesn't work I think that this line of code (from the conversion) is the cause off all this trouble:
co = R + 256 * G + 256 * 256 * B


if I use you're code I keep getting 0-values for R,G,B nomatter wich color I'm using Confused | :confused:


Luc Pattyn wrote:
BTW there is no need for magic constants such as 16777215 (which is 0x00FFFFFF)


I know Poke tongue | ;-P but on paper it's easier to look at the number Poke tongue | ;-P

to make it easier to read here is the entire code again
Dim R As Byte = &HFF - color.R
        Dim G As Byte = &HFF - color.G
        Dim B As Byte = &HFF - color.B
        Dim co, cn As Integer
        co = R + 256 * G + 256 * 256 * B
        cn = &HFFFFFF - co

        Return cn

'cn' is the value stored in the db and also the value that needs to be converted back to a color

If my help was helpfull let me know, if not let me know why.

The only way we learn is by making mistaks.

GeneralRe: conversion color - hexnumber - color Pin
Luc Pattyn13-Sep-07 3:18
sitebuilderLuc Pattyn13-Sep-07 3:18 
GeneralRe: conversion color - hexnumber - color Pin
Tom Deketelaere13-Sep-07 3:26
professionalTom Deketelaere13-Sep-07 3:26 
GeneralRe: conversion color - hexnumber - color Pin
Tim Craig13-Sep-07 18:21
Tim Craig13-Sep-07 18:21 
GeneralRe: conversion color - hexnumber - color Pin
Tom Deketelaere13-Sep-07 20:46
professionalTom Deketelaere13-Sep-07 20:46 
AnswerRe: conversion color - hexnumber - color Pin
Jeremy Falcon25-Sep-07 8:45
professionalJeremy Falcon25-Sep-07 8:45 
QuestionDinamyc priority asignation Pin
Nelek12-Sep-07 4:18
protectorNelek12-Sep-07 4:18 
AnswerRe: Dinamyc priority asignation Pin
Russell'13-Sep-07 6:54
Russell'13-Sep-07 6:54 
GeneralRe: Dinamyc priority asignation Pin
Nelek13-Sep-07 22:52
protectorNelek13-Sep-07 22:52 
GeneralRe: Dinamyc priority asignation Pin
Russell'14-Sep-07 0:02
Russell'14-Sep-07 0:02 
GeneralRe: Dinamyc priority asignation Pin
Nelek14-Sep-07 0:51
protectorNelek14-Sep-07 0:51 
GeneralRe: Dinamyc priority asignation Pin
Russell'14-Sep-07 1:07
Russell'14-Sep-07 1:07 
GeneralRe: Dinamyc priority asignation Pin
Nelek14-Sep-07 1:51
protectorNelek14-Sep-07 1:51 
GeneralRe: Dinamyc priority asignation Pin
Russell'14-Sep-07 2:17
Russell'14-Sep-07 2:17 
GeneralRe: Dinamyc priority asignation Pin
Nelek25-Sep-07 2:17
protectorNelek25-Sep-07 2:17 
GeneralRe: Dinamyc priority asignation Pin
Russell'25-Sep-07 3:03
Russell'25-Sep-07 3:03 
QuestionSemi automatic forground video segmentation Pin
ptr_Electron12-Sep-07 0:17
ptr_Electron12-Sep-07 0:17 
AnswerRe: Semi automatic forground video segmentation Pin
Russell'12-Sep-07 2:34
Russell'12-Sep-07 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.