Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to Converta RGB color to a CMYK color?

Answer Posted / Mr Praveen Kumar Jain

Converting an RGB color to CMYK in Delphi can be done using the following formula:nn```delphinfunction RGBToCMYK(r, g, b: Byte): TColor;nvarn c, m, y, k: Double;nbeginn r := r / 255; g := g / 255; b := b / 255;nn // Find minimum valuen if (r < g) and (r < b) thenn c := r;n else if g < b thenn c := g;n elsen c := b;nn // Calculate remaining valuesn m := (r - c) / (1 - c);n y := (g - c) / (1 - c);n k := (b - c) / (1 - c);nn // Convert CMYK values to TColor and returnn Result := RGBToCMYK_TColor(c, m, y, k);nend;nnfunction RGBToCMYK_TColor(c, m, y, k: Double): TColor;nbeginn // Adjust CMYK values to fit within range (0-255)n c := Round(c * 255); m := Round(m * 255); y := Round(y * 255); k := Round(k * 255);nn // Create a TColor with CMYK values and returnn Result := TColor.CMYKToRGB(c, m, y, k);nend;n```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to Determine the last access time of a given file ?

1820


How can one prevent a TForm from being moved or resized?

1759


How to Create resource files?

1642


How to Print in Delphi without using the TPrinter Unit ?

1896


How to Get the time and date in Universal Time ?

1750


How to Retrieving the program that is associated with a given extension?

1689


How to Remove drives listed in a TDriveComboBox ?

1937


How to Change the owner of a component at runtime ?

1916


How to Flush binary file from disk cache to disk ?

2043


How to Retrieve the line number that a memo's cursor is on?

1978


How to Save a QuickReport custom preview to text?

3381


How to Change the default width/height of the editor?

1891