Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change picture color
Message
From
19/07/2004 07:20:47
 
 
To
17/07/2004 04:33:51
General information
Forum:
Visual FoxPro
Category:
Pictures and Image processing
Miscellaneous
Thread ID:
00925117
Message ID:
00925691
Views:
12
This message has been marked as the solution to the initial question of the thread.
I am about to give you simple solution.

At first bitmaps must be external files (excluded from project and distributed with executable). It's better to use temporary files. (Editing files in program dir is not allowed for normal user accounts on NT and higher systems). Thus you need to dynamicaly assign Picture properties. :(((
But you can code this once only in parent class.

At second you may not edit all pixels of picture while you can only change palette color from black to what you need.

This example code replaces "black" palette color in source file with nColor and saves modified picture to target bmp file.
LPARAMETERS cSource, cTarget, nColor

#define StartPosition 55

LOCAL lcBMP, lcColor
lcBmp = FILETOSTR(cSource)

lcColor = ;
    CHR(BITRSHIFT(BITAND(0xFF0000, nColor), 16)) ;
  + CHR(BITRSHIFT(BITAND(0xFF00, nColor), 8)) ;
  + CHR(BITAND(0xFF, nColor))

lcBMP = STUFF(lcBMP, StartPosition, 3, lcColor)

STRTOFILE(lcBMP, cTarget)
Hope this helps
/A new technology turns into completely outdated stuff before you have a time to read "Getting Started..." section.
/If there are some "system programmers" then others are unsystematic.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform