Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: [Solved] What is the 32-bit form of the _InterlockedIncrement intrinsic? Pin
Randor 22-Sep-09 13:33
professional Randor 22-Sep-09 13:33 
GeneralRe: [Solved] What is the 32-bit form of the _InterlockedIncrement intrinsic? Pin
Skippums22-Sep-09 14:00
Skippums22-Sep-09 14:00 
QuestionGreyscale image from raw data Pin
David Ferreira22-Sep-09 4:57
David Ferreira22-Sep-09 4:57 
AnswerRe: Greyscale image from raw data Pin
includeh1022-Sep-09 5:20
includeh1022-Sep-09 5:20 
AnswerRe: Greyscale image from raw data Pin
enhzflep22-Sep-09 20:02
enhzflep22-Sep-09 20:02 
GeneralRe: Greyscale image from raw data Pin
David Ferreira22-Sep-09 21:26
David Ferreira22-Sep-09 21:26 
GeneralRe: Greyscale image from raw data Pin
enhzflep22-Sep-09 23:15
enhzflep22-Sep-09 23:15 
GeneralRe: Greyscale image from raw data Pin
David Ferreira23-Sep-09 0:58
David Ferreira23-Sep-09 0:58 
I realized what you said after a bit more fiddling it is a good idea and i just need to figure out how to do it ^.^
I'm starting to run out of time though so had to do a bit of a hack. I'll be working on this again when i find the time though i was enjoying it. Here's what i did just in case it helps anyone else.


I get the bytes one byte at a time so this is inside that loop. It could obviously be in a loop of its own just as easily though.

//replace colours with black
		if(data[a] == 208)
		{
			data[a] = 75;
			
		}

What this does is turn any colour that i what to suppress into black.
The black is somewhere between 192 and 208.


This Creates the bitmap once i have the raw pixels in the array

CClientDC dc(this); // device context for painting

BITMAPINFO bmi; //header stuct

bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth  = 208;
bmi.bmiHeader.biHeight = 208;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 8;
bmi.bmiHeader.biCompression = BI_RGB;
bmi.bmiHeader.biSizeImage = 0;
bmi.bmiHeader.biXPelsPerMeter = 0;
bmi.bmiHeader.biYPelsPerMeter = 0;
bmi.bmiHeader.biClrUsed = 0;
bmi.bmiHeader.biClrImportant = 0;

CBitmap bitmap;
bitmap.CreateCompatibleBitmap(&dc,208,208); //create 208x208 bitmap
::SetDIBits(dc.m_hDC,bitmap,0,208,rawImageArray,&bmi,DIB_RGB_COLORS);// sets the bits to array
CDC dcMemory;
dcMemory.CreateCompatibleDC(&dc);
CBitmap * pOldBitmap = dcMemory.SelectObject(&bitmap);
dc.StretchBlt(0,0, m_nW,m_nH, &dcMemory, 0,0,208,208 , SRCCOPY);//strechs to size of active x window
dcMemory.SelectObject(pOldBitmap);

AnswerRe: Greyscale image from raw data Pin
David Ferreira19-Nov-09 23:30
David Ferreira19-Nov-09 23:30 
QuestionCreation of install shield Pin
shir_k22-Sep-09 3:55
shir_k22-Sep-09 3:55 
AnswerRe: Creation of install shield Pin
PJ Arends22-Sep-09 4:55
professionalPJ Arends22-Sep-09 4:55 
GeneralRe: Creation of install shield Pin
shir_k4-Oct-09 21:24
shir_k4-Oct-09 21:24 
Questionhow to convert char * to char[100] Pin
prithaa22-Sep-09 3:54
prithaa22-Sep-09 3:54 
AnswerRe: how to convert char * to char[100] Pin
Chris Losinger22-Sep-09 4:10
professionalChris Losinger22-Sep-09 4:10 
AnswerRe: how to convert char * to char[100] Pin
Rajesh R Subramanian22-Sep-09 4:30
professionalRajesh R Subramanian22-Sep-09 4:30 
Generalagree! Pin
etkid8422-Sep-09 5:55
etkid8422-Sep-09 5:55 
GeneralRe: agree! Pin
Rajesh R Subramanian22-Sep-09 6:01
professionalRajesh R Subramanian22-Sep-09 6:01 
Generaloops, my bad Pin
etkid8422-Sep-09 6:10
etkid8422-Sep-09 6:10 
AnswerRe: how to convert char * to char[100] Pin
Skippums22-Sep-09 8:57
Skippums22-Sep-09 8:57 
QuestionHow to get cureent url from firefox address bar... Pin
onlyjaypatel22-Sep-09 3:35
onlyjaypatel22-Sep-09 3:35 
Questionaccess to the task manager Pin
einstein.girl22-Sep-09 3:27
einstein.girl22-Sep-09 3:27 
QuestionRe: access to the task manager Pin
David Crow22-Sep-09 3:34
David Crow22-Sep-09 3:34 
AnswerRe: access to the task manager Pin
kilt24-Sep-09 7:10
kilt24-Sep-09 7:10 
QuestionSleep Pin
VVVimal22-Sep-09 3:24
VVVimal22-Sep-09 3:24 
QuestionRe: Sleep Pin
David Crow22-Sep-09 3:35
David Crow22-Sep-09 3:35 

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.