Click here to Skip to main content
15,922,166 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DrawDragRect Pin
JWood20-Dec-04 13:37
JWood20-Dec-04 13:37 
GeneralRe: DrawDragRect Pin
poiut22-Dec-04 6:29
poiut22-Dec-04 6:29 
QuestionWhy is my printed image blown up? Pin
giannibal20-Dec-04 9:49
giannibal20-Dec-04 9:49 
GeneralHelp me with image displaying solutions Pin
Budric B.20-Dec-04 7:44
Budric B.20-Dec-04 7:44 
GeneralAlso... Pin
Budric B.20-Dec-04 7:49
Budric B.20-Dec-04 7:49 
GeneralRe: Also... Pin
Christian Graus20-Dec-04 9:45
protectorChristian Graus20-Dec-04 9:45 
GeneralRe: Help me with image displaying solutions Pin
Christian Graus20-Dec-04 9:43
protectorChristian Graus20-Dec-04 9:43 
GeneralRe: Help me with image displaying solutions Pin
Budric B.20-Dec-04 10:31
Budric B.20-Dec-04 10:31 
I'm basically trying to output *.ppm and *.pgm files. The file format of ppm is a simple header followed by 24 bits for RGB for each pixel. For the pgm it's a simple header followed by 8 bits per pixel.

I can read and display the ppm files using this bit of code:
<br />
		BITMAPINFO bi ;<br />
		bi.bmiHeader.biSize          = sizeof( BITMAPINFOHEADER );<br />
		bi.bmiHeader.biWidth         = m_nWidth;<br />
		bi.bmiHeader.biHeight        = -m_nHeight; // top-down bitmap, negative height<br />
		bi.bmiHeader.biPlanes        = 1;<br />
		bi.bmiHeader.biBitCount      = 24;<br />
		bi.bmiHeader.biCompression   = BI_RGB;<br />
		bi.bmiHeader.biSizeImage     = ::abs( m_nWidth*m_nHeight ) * 3;<br />
		bi.bmiHeader.biXPelsPerMeter = 100;<br />
		bi.bmiHeader.biYPelsPerMeter = 100;<br />
		bi.bmiHeader.biClrUsed       = 0;<br />
		bi.bmiHeader.biClrImportant  = 0;<br />
<br />
		::SetDIBitsToDevice(<br />
			dc.GetSafeHdc(),<br />
			0, <br />
			0,<br />
			m_nWidth, <br />
			m_nHeight,<br />
			0, <br />
			0,<br />
			0, <br />
			m_nHeight,<br />
			m_pImage, <br />
			&bi, <br />
			DIB_RGB_COLORS );<br />

However this doesn't work for the pgm images. I don't know what header to set or how to display it unless I physically take the data I loaded in the pointer and insert R=G=B=original grayscale data.
GeneralWindows Hook Pin
RedDragon2k20-Dec-04 5:13
RedDragon2k20-Dec-04 5:13 
GeneralRe: Windows Hook Pin
Michael Dunn20-Dec-04 7:17
sitebuilderMichael Dunn20-Dec-04 7:17 
GeneralRe: Windows Hook Pin
RedDragon2k20-Dec-04 7:30
RedDragon2k20-Dec-04 7:30 
GeneralRe: Windows Hook Pin
heman15420-Dec-04 9:27
heman15420-Dec-04 9:27 
GeneralRe: Windows Hook Pin
Shog920-Dec-04 12:35
sitebuilderShog920-Dec-04 12:35 
GeneralDoModal returns -1 Pin
AnsGe20-Dec-04 4:30
AnsGe20-Dec-04 4:30 
GeneralRe: DoModal returns -1 Pin
toxcct20-Dec-04 5:47
toxcct20-Dec-04 5:47 
GeneralRe: DoModal returns -1 Pin
David Crow20-Dec-04 6:16
David Crow20-Dec-04 6:16 
GeneralRe: DoModal returns -1 Pin
AnsGe20-Dec-04 6:55
AnsGe20-Dec-04 6:55 
GeneralRe: DoModal returns -1 Pin
David Crow20-Dec-04 8:12
David Crow20-Dec-04 8:12 
GeneralRe: DoModal returns -1 Pin
Michael Dunn20-Dec-04 7:25
sitebuilderMichael Dunn20-Dec-04 7:25 
GeneralRe: DoModal returns -1 Pin
AnsGe20-Dec-04 7:35
AnsGe20-Dec-04 7:35 
GeneralChecking an ocx is installed or not Pin
AnsGe20-Dec-04 4:21
AnsGe20-Dec-04 4:21 
GeneralRe: Checking an ocx is installed or not Pin
Blake Miller20-Dec-04 6:11
Blake Miller20-Dec-04 6:11 
GeneralRe: Checking an ocx is installed or not Pin
AnsGe20-Dec-04 6:47
AnsGe20-Dec-04 6:47 
GeneralRe: Checking an ocx is installed or not Pin
Blake Miller20-Dec-04 7:05
Blake Miller20-Dec-04 7:05 
GeneralRe: Checking an ocx is installed or not Pin
naren-vc21-Dec-04 22:32
naren-vc21-Dec-04 22:32 

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.