Click here to Skip to main content
15,905,563 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Modeless Propertysheet Pin
PJ Arends26-Dec-04 21:45
professionalPJ Arends26-Dec-04 21:45 
GeneralRe: Modeless Propertysheet Pin
lisoft27-Dec-04 13:40
lisoft27-Dec-04 13:40 
QuestionHow to display a specifique layer from a photoshop file ? Pin
Dani10000126-Dec-04 15:26
Dani10000126-Dec-04 15:26 
Questionwhat's the unit of the return value of GetTextExtent()? Pin
Fei Xu26-Dec-04 15:14
Fei Xu26-Dec-04 15:14 
QuestionHow to change the button's text color? Pin
chenbuaa26-Dec-04 14:02
chenbuaa26-Dec-04 14:02 
GeneralEnums alignment Pin
TheSharkOfDil26-Dec-04 8:57
sussTheSharkOfDil26-Dec-04 8:57 
GeneralRe: Enums alignment Pin
John R. Shaw26-Dec-04 12:04
John R. Shaw26-Dec-04 12:04 
GeneralProblem with changing color of a pixel in a bitmap! Pin
Dani10000126-Dec-04 7:29
Dani10000126-Dec-04 7:29 
Hi, I am trying to change the color in a bitmap.

I have used :

hbm = CreateDIBSection( NULL, pbmInfo, DIB_RGB_COLORS, &lpBits,
hSection, dwOffset );

DWORD *data=lpBits;


to get the pointer to the pixels.

Then I try to set all the pixels to red using this code:

lPitch= (((24*bmInfo.bmiHeader.biWidth + 31) & (~31))/8); //pitch in bytes

for(y=0;y<bmInfo.bmiHeader.biHeight;y++)
{
for(x=0;x<bmInfo.bmiHeader.biWidth;x++)
{
data[x]=0x00ff0000; // fill pixels with red color
}
data+=lPitch/sizeof(DWORD); //sizeof(DWORD) = 4
}

But when I save the bitmap I get a bitmap with some striped pattern.

I am using 24 color bitmap.

Perhaps the pitch is wrong, but I cannot see any wrong with it?

Does anyone has a clue, what might be wrong?

Please help, thanks Dani Cry | :((
GeneralRe: Problem with changing color of a pixel in a bitmap! Pin
John R. Shaw26-Dec-04 12:35
John R. Shaw26-Dec-04 12:35 
GeneralRe: Problem with changing color of a pixel in a bitmap! Pin
Dani10000126-Dec-04 15:16
Dani10000126-Dec-04 15:16 
GeneralRe: Problem with changing color of a pixel in a bitmap! Pin
John R. Shaw27-Dec-04 6:04
John R. Shaw27-Dec-04 6:04 
GeneralRe: Problem with changing color of a pixel in a bitmap! Pin
PJ Arends26-Dec-04 22:06
professionalPJ Arends26-Dec-04 22:06 
GeneralRe: Problem with changing color of a pixel in a bitmap! Pin
John R. Shaw27-Dec-04 6:16
John R. Shaw27-Dec-04 6:16 
Generalquestion Pin
gamitech26-Dec-04 6:14
gamitech26-Dec-04 6:14 
GeneralRe: question Pin
Yulianto.26-Dec-04 13:54
Yulianto.26-Dec-04 13:54 
GeneralRe: question Pin
PJ Arends26-Dec-04 22:27
professionalPJ Arends26-Dec-04 22:27 
GeneralReplacing the mmemory allocator for &quot;CoGetMalloc&quot; function Pin
impeham26-Dec-04 5:34
impeham26-Dec-04 5:34 
GeneralHelp in Editing Icon Pin
Azghar Hussain26-Dec-04 4:07
professionalAzghar Hussain26-Dec-04 4:07 
GeneralNeed a fancy name for a 'combined' variable Pin
TrueTom26-Dec-04 2:42
TrueTom26-Dec-04 2:42 
GeneralRe: Need a fancy name for a 'combined' variable Pin
User 665826-Dec-04 7:52
User 665826-Dec-04 7:52 
GeneralRe: Need a fancy name for a 'combined' variable Pin
TrueTom27-Dec-04 1:35
TrueTom27-Dec-04 1:35 
GeneralRe: Need a fancy name for a 'combined' variable Pin
TrueTom27-Dec-04 2:16
TrueTom27-Dec-04 2:16 
Generalupload files Pin
StoreErin26-Dec-04 1:26
StoreErin26-Dec-04 1:26 
GeneralRe: upload files Pin
Neville Franks26-Dec-04 9:56
Neville Franks26-Dec-04 9:56 
GeneralRe: upload files Pin
StoreErin26-Dec-04 13:26
StoreErin26-Dec-04 13:26 

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.