Click here to Skip to main content
15,921,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalweird stream << "behavior" Pin
froyd20-Sep-04 20:47
froyd20-Sep-04 20:47 
GeneralActiveX control in VC.Net Pin
Amol Chavan20-Sep-04 20:30
Amol Chavan20-Sep-04 20:30 
Generallocal window hook Pin
Sung-Won20-Sep-04 20:06
Sung-Won20-Sep-04 20:06 
GeneralDoes this Code look robust Pin
Monty220-Sep-04 19:20
Monty220-Sep-04 19:20 
GeneralRe: Does this Code look robust Pin
User 58385220-Sep-04 20:43
User 58385220-Sep-04 20:43 
GeneralRe: Does this Code look robust Pin
Monty220-Sep-04 21:12
Monty220-Sep-04 21:12 
GeneralRe: Does this Code look robust Pin
User 58385221-Sep-04 11:48
User 58385221-Sep-04 11:48 
GeneralMFC: Mouse Right-Click Event to remove and set the black spots in an image from 255 to 0 Pin
pohcb_sonic20-Sep-04 18:07
pohcb_sonic20-Sep-04 18:07 
I actually had previously used it to do console applications on Visual C++ but never used MFC before. I had a problem; I was told to set a 10 by 10 area by using Matrix in MFC coding and use it to check whether the image has any little "black spots". If it does, I have to set these small little "black spots" of the image from "255" or anything else to zero. The codings must be in a function.

I did it but there were some problems with the codes. It does not work!!

Pls do kindly reply. I needed this asap. Thanks!

Below are the codes:

<br />
void CMediVisionView::MatrixImage() //MatrixImage() does the image-cleaning to wipe out all the dirt found in the selected portion of image.<br />
{									<br />
	int i, n, refer;<br />
<br />
if(no_of_rows==512 && no_of_cols==512){<br />
<br />
refer = 0;<br />
	<br />
n = 0;<br />
for(i=0; i<512-5; i++)<br />
{<br />
if (image512[n]==0 && image512[n+1]==0 && image512[n+2]==0 && image512[n+3]==0 && image512[n+4]==0 && image512[n+5]==0 && image512[n+6]==0 && image512[n+7]==0 && image512[n+8]==0 && image512[n+9]==0){<br />
<br />
if(image512[n]==0 && image512[n+512]==0 && image512[n+(512*2)]==0 && image512[n+(512*3)]==0 && image512[n+(512*4)]==0 && image512[n+(512*5)]==0 && image512[n+(512*6)]==0 && image512[n+(512*7)]==0 && image512[n+(512*8)]==0 && image512[n+(512*9)]==0){<br />
<br />
if(image512[n+9]==0 && image512[n+512+9]==0 && image512[n+(512*2)+9]==0 && image512[n+(512*3)+9]==0 && image512[n+(512*5)+9]==0 && image512[n+(512*6)+9]==0 && image512[n+(512*7)+9]==0 && image512[n+(512*8)+9]==0 && image512[n+(512*9)+9]==0){<br />
<br />
if(image512[n+(512*9)]==0 && image512[n+(512*9)+1]==0 && image512[n+(512*9)+2]==0 && image512[n+(512*9)+3]==0 && image512[n+(512*9)+4]==0 && image512[n+(512*9)+5]==0 && image512[n+(512*9)+6]==0 && image512[n+(512*9)+7]==0 && image512[n+(512*9)+8]==0 && image512[n+(512*9)+9]==0){<br />
					<br />
image512[(n+512)+1]=0;<br />
image512[(n+512)+2]=0;<br />
image512[(n+512)+3]=0;<br />
image512[(n+512)+4]=0;<br />
image512[(n+512)+5]=0;<br />
image512[(n+512)+6]=0;<br />
image512[(n+512)+7]=0;<br />
image512[(n+512)+8]=0;<br />
						<br />
<br />
image512[n+(512*2)+1]=0;<br />
image512[n+(512*2)+2]=0;<br />
image512[n+(512*2)+3]=0;<br />
image512[n+(512*2)+4]=0;<br />
image512[n+(512*2)+5]=0;<br />
image512[n+(512*2)+6]=0;<br />
image512[n+(512*2)+7]=0;<br />
image512[n+(512*2)+8]=0;<br />
						                                                                  <br />
image512[n+(512*3)+1]=0;<br />
image512[n+(512*3)+2]=0;<br />
image512[n+(512*3)+3]=0;<br />
image512[n+(512*3)+4]=0;<br />
image512[n+(512*3)+5]=0;<br />
image512[n+(512*3)+6]=0;<br />
image512[n+(512*3)+7]=0;<br />
image512[n+(512*3)+8]=0;<br />
<br />
<br />
						<br />
image512[n+(512*4)+1]=0;<br />
image512[n+(512*4)+2]=0;<br />
image512[n+(512*4)+3]=0;<br />
image512[n+(512*4)+4]=0;<br />
image512[n+(512*4)+5]=0;<br />
image512[n+(512*4)+6]=0;<br />
image512[n+(512*4)+7]=0;<br />
image512[n+(512*4)+8]=0;<br />
<br />
<br />
						<br />
image512[n+(512*5)+1]=0;<br />
image512[n+(512*5)+2]=0;<br />
image512[n+(512*5)+3]=0;<br />
image512[n+(512*5)+4]=0;<br />
image512[n+(512*5)+5]=0;<br />
image512[n+(512*5)+6]=0;					<br />
image512[n+(512*5)+7]=0;<br />
image512[n+(512*5)+8]=0;<br />
<br />
						<br />
						<br />
image512[n+(512*6)+1]=0;<br />
image512[n+(512*6)+2]=0;<br />
image512[n+(512*6)+3]=0;<br />
image512[n+(512*6)+4]=0;<br />
image512[n+(512*6)+5]=0;<br />
image512[n+(512*6)+6]=0;<br />
image512[n+(512*6)+7]=0;<br />
image512[n+(512*6)+8]=0;<br />
<br />
						<br />
						<br />
image512[n+(512*7)+1]=0;<br />
image512[n+(512*7)+2]=0;<br />
image512[n+(512*7)+3]=0;<br />
image512[n+(512*7)+4]=0;<br />
image512[n+(512*7)+5]=0;<br />
image512[n+(512*7)+6]=0;<br />
image512[n+(512*7)+7]=0;<br />
image512[n+(512*7)+8]=0;<br />
<br />
<br />
image512[n+(512*8)+1]=0;<br />
image512[n+(512*8)+2]=0;<br />
image512[n+(512*8)+3]=0;<br />
image512[n+(512*8)+4]=0;<br />
image512[n+(512*8)+5]=0;<br />
image512[n+(512*8)+6]=0;<br />
image512[n+(512*8)+7]=0;<br />
image512[n+(512*8)+8]=0;<br />
						<br />
refer = 0;<br />
n++;<br />
refer++;<br />
}<br />
}<br />
}<br />
}<br />
}<br />
}<br />
<br />
}<br />
<br />

GeneralRe: MFC: Mouse Right-Click Event to remove and set the black spots in an image from 255 to 0 Pin
Christian Graus20-Sep-04 18:24
protectorChristian Graus20-Sep-04 18:24 
GeneralCListBox formatting Pin
stevieo8420-Sep-04 18:07
stevieo8420-Sep-04 18:07 
GeneralRe: CListBox formatting Pin
Branislav21-Sep-04 1:07
Branislav21-Sep-04 1:07 
Questioncan accelerator keys be intercepted by ActiveX ? Pin
somesoft20-Sep-04 17:11
somesoft20-Sep-04 17:11 
QuestionPassing variables to function called by a thread?!?!?? Pin
Zero_G20-Sep-04 14:37
Zero_G20-Sep-04 14:37 
AnswerRe: Passing variables to function called by a thread?!?!?? Pin
David Crow20-Sep-04 16:56
David Crow20-Sep-04 16:56 
AnswerRe: Passing variables to function called by a thread?!?!?? Pin
stevieo8420-Sep-04 18:20
stevieo8420-Sep-04 18:20 
AnswerRe: Passing variables to function called by a thread?!?!?? Pin
V.20-Sep-04 23:29
professionalV.20-Sep-04 23:29 
QuestionWhy public destructors? Pin
Anonymous20-Sep-04 11:16
Anonymous20-Sep-04 11:16 
AnswerRe: Why public destructors? Pin
Christian Graus20-Sep-04 11:30
protectorChristian Graus20-Sep-04 11:30 
GeneralRe: Why public destructors? Pin
Anonymous20-Sep-04 11:53
Anonymous20-Sep-04 11:53 
GeneralRe: Why public destructors? Pin
Jörgen Sigvardsson20-Sep-04 13:22
Jörgen Sigvardsson20-Sep-04 13:22 
GeneralRe: Why public destructors? Pin
Christian Graus20-Sep-04 16:16
protectorChristian Graus20-Sep-04 16:16 
GeneralHelp with CTreeCtrl TVS_HASBUTTONS vs NM_CLICK Pin
Cedar Sith20-Sep-04 11:00
Cedar Sith20-Sep-04 11:00 
GeneralRe: Help with CTreeCtrl TVS_HASBUTTONS vs NM_CLICK Pin
Aamir Butt20-Sep-04 22:16
Aamir Butt20-Sep-04 22:16 
GeneralRe: Help with CTreeCtrl TVS_HASBUTTONS vs NM_CLICK Pin
Cedar Sith21-Sep-04 8:40
Cedar Sith21-Sep-04 8:40 
GeneralRe: Help with CTreeCtrl TVS_HASBUTTONS vs NM_CLICK Pin
RChin21-Sep-04 0:35
RChin21-Sep-04 0: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.