Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Want to change colors in a bitmap file
Message
 
À
11/10/1999 04:49:09
Vinod Parwani
United Creations L.L.C.
Ad-Dulayl, Jordanie
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Divers
Thread ID:
00274721
Message ID:
00274874
Vues:
32
Vinod,

This is not an easy thing to do programmatically. What I'm going to write applies only to 24 bit color bitmaps. 16 color, 256 color and 32 bit color are different.

Two structures (BITMAPFILEHEADER and BITMAPINFO) make up the first 54 bytes of the file. The color data is stored beginning at byte 55. The colors are stored in a Blue, Green, Red format in terms of the order they appear in the file. You'll have to figure out the exact color your looking for (white is easy since it's CHR(255) + CHR(255) + CHR(255)) and what the color value should be of the replacement. The HexEdit.app can be of help here.

I'd use FILETOSTR() to load the file into a string, then parse it in 3 byte increments look for the exact match and when found replacing it accordingly.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform