Click here to Skip to main content
15,929,867 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to use same handle in seperate thread Pin
Carlos Antollini23-Oct-01 6:09
Carlos Antollini23-Oct-01 6:09 
Answerwhy not use DuplicateHandle Pin
BruteBertus24-Oct-01 0:31
BruteBertus24-Oct-01 0:31 
GeneralRGB Pin
23-Oct-01 5:51
suss23-Oct-01 5:51 
GeneralRe: RGB Pin
Christian Graus23-Oct-01 9:35
protectorChristian Graus23-Oct-01 9:35 
GeneralRe: RGB Pin
23-Oct-01 11:13
suss23-Oct-01 11:13 
GeneralRe: RGB Pin
Christian Graus23-Oct-01 11:25
protectorChristian Graus23-Oct-01 11:25 
GeneralRe: RGB Pin
23-Oct-01 12:14
suss23-Oct-01 12:14 
GeneralRe: RGB Pin
23-Oct-01 12:27
suss23-Oct-01 12:27 
I work with microscope and i have avi file from surface.
I need intensity of every pixel. I need it for mathematical manipulations with images (filters and other stuff). So, i open avi file and take a frame from avi like
LPBITMAPINFOHEADER lpBitmap = (LPBITMAPINFOHEADER)AVIStreamGetFrame(pVideoFrame, nFrame);

and save it as txt file, which works for 24 and 32 bpp.

But i need 8 bpp and 16 bpp bitmaps (little size)

//Code

int BytesPerPixel = (lpBitmap->biSizeImage)
/(lpBitmap->biHeight * lpBitmap->biWidth);

int WidthBytes = lpBitmap->biWidth * BytesPerPixel;

int size = sizeof(BITMAPINFOHEADER)
+ sizeof(RGBQUAD) * lpBitmap->biClrUsed;

BYTE *Bits = (LPBYTE)lpBitmap
+ size;

BYTE * ScanLine;
BYTE * Data;
unsigned long Red, Green, Blue;

CStdioFile skadr;
CString string;
skadr.Open(filename, CFile::modeCreate|CFile::modeWrite);


for( int y = lpBitmap->biHeight; y>0; --y )
{

ScanLine = Bits + (WidthBytes * (y-1));
Data = ScanLine;

for( int x = 0; x<lpbitmap->biWidth - 1; ++x )
{
LPRGBQUAD Quad = (LPRGBQUAD) Data;

Blue = Quad->rgbBlue;
Green = Quad->rgbGreen;
Red = Quad->rgbRed;

unsigned long color = (Red * 0.299)
+ (Green * 0.587)
+ (Blue * 0.114);

string.Format("\t %d", color);
skadr.WriteString(string);

Data += BytesPerPixel;
}

string.Format("\n" );
skadr.WriteString(string);

}
GeneralRe: RGB Pin
Christian Graus23-Oct-01 16:14
protectorChristian Graus23-Oct-01 16:14 
GeneralRe: RGB Pin
24-Oct-01 3:41
suss24-Oct-01 3:41 
GeneralShowHTMLDialogEx and Print Template Pin
23-Oct-01 5:40
suss23-Oct-01 5:40 
GeneralMessage handling Pin
Nick Armstrong23-Oct-01 4:35
Nick Armstrong23-Oct-01 4:35 
Generalphysical drive Pin
Jon Hulatt23-Oct-01 4:34
Jon Hulatt23-Oct-01 4:34 
GeneralAny Other site on VC++ Pin
Imran Farooqui23-Oct-01 4:33
Imran Farooqui23-Oct-01 4:33 
GeneralRe: Any Other site on VC++ Pin
Steve L.23-Oct-01 9:13
Steve L.23-Oct-01 9:13 
GeneralRe: Any Other site on VC++ Pin
23-Oct-01 23:29
suss23-Oct-01 23:29 
Generalifstream works, ofstream works, fstream doesn't.. Pin
Bernhard23-Oct-01 4:31
Bernhard23-Oct-01 4:31 
GeneralRe: ifstream works, ofstream works, fstream doesn't.. Pin
markkuk23-Oct-01 20:19
markkuk23-Oct-01 20:19 
GeneralRe: ifstream works, ofstream works, fstream doesn't.. Pin
Bernhard23-Oct-01 20:23
Bernhard23-Oct-01 20:23 
GeneralRe: ifstream works, ofstream works, fstream doesn't.. Pin
markkuk23-Oct-01 20:41
markkuk23-Oct-01 20:41 
QuestionHow Can I set a CDialog's location when it display? Pin
Bing Ding23-Oct-01 4:30
Bing Ding23-Oct-01 4:30 
AnswerRe: How Can I set a CDialog's location when it display? Pin
#realJSOP23-Oct-01 4:50
professional#realJSOP23-Oct-01 4:50 
GeneralRe: How Can I set a CDialog's location when it display? Pin
Bing Ding23-Oct-01 4:57
Bing Ding23-Oct-01 4:57 
GeneralRe: Which line do u put MoveWindow? Pin
Masaaki Onishi23-Oct-01 5:23
Masaaki Onishi23-Oct-01 5:23 
GeneralRe: Which line do u put MoveWindow? Pin
Carlos Antollini23-Oct-01 5:42
Carlos Antollini23-Oct-01 5:42 

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.