Click here to Skip to main content
15,918,243 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPlease help me! Pin
dSolariuM3-Apr-05 9:04
dSolariuM3-Apr-05 9:04 
GeneralRe: Please help me! Pin
ThatsAlok3-Apr-05 18:51
ThatsAlok3-Apr-05 18:51 
GeneralC++ convert numbers to words Pin
supaman198813-Apr-05 8:44
supaman198813-Apr-05 8:44 
GeneralRe: C++ convert numbers to words Pin
David Crow4-Apr-05 3:09
David Crow4-Apr-05 3:09 
General.pch file wont copy over Pin
bonosa3-Apr-05 6:56
bonosa3-Apr-05 6:56 
GeneralRe: .pch file wont copy over Pin
Ravi Bhavnani3-Apr-05 7:52
professionalRavi Bhavnani3-Apr-05 7:52 
GeneralRe: .pch file wont copy over Pin
bonosa3-Apr-05 9:14
bonosa3-Apr-05 9:14 
GeneralLook into this code of floodfill. Running out of memory. Pin
awasthy3-Apr-05 6:14
awasthy3-Apr-05 6:14 
Please see this code here I am trying to fill all the pixels of a particular color with black. The figure is irregular so I can't use any of the known fill functions. The problem here is that the processing stops after some time. Probably runs out of memory(as shown by an error when the same code was run in VB).

If anyone knows any fill function for an irregular object, or can debug this code suggest it.

Any help woul be appriciated.


void dlg::floodfill(int x, int y, int r , int g, int b)// x,y are pixel positions r,g,b are color components, pixels coloured with these have to be found and replaced
{
CClientDC dc(this);
COLORREF rgb,rgb1;

rgb=dc.GetPixel(x,y);

BYTE r1,g1,b1;
r1=GetRValue(rgb);
g1=GetGValue(rgb);
b1=GetBValue(rgb);

if((r1<r+20)&&(r1>r-20))
if((g1<g+20)&&(g1>g-20))
if((b1<b+20)&&(b1>b-20))
{
rgb=RGB(0,0,0);
rgb1=dc.SetPixel(x,y,rgb);
floodfill(x-1,y-1,r,g,b);
floodfill(x,y-1,r,g,b);
floodfill(x+1,y-1,r,g,b);
floodfill(x-1,y,r,g,b);
floodfill(x+1,y,r,g,b);
floodfill(x-1,y+1,r,g,b);
floodfill(x,y+1,r,g,b);
floodfill(x+1,y+1,r,g,b);
}
}

Awasthy

Any work worth doing is worth doing well.
GeneralRe: Look into this code of floodfill. Running out of memory. Pin
Ravi Bhavnani3-Apr-05 7:53
professionalRavi Bhavnani3-Apr-05 7:53 
GeneralRe: Look into this code of floodfill. Running out of memory. Pin
squidev3-Apr-05 7:58
squidev3-Apr-05 7:58 
GeneralRe: Look into this code of floodfill. Running out of memory. Pin
Mike Dimmick3-Apr-05 8:41
Mike Dimmick3-Apr-05 8:41 
GeneralSet Visual Style for an application (and only for it) Pin
gabriel.fischer3-Apr-05 4:22
gabriel.fischer3-Apr-05 4:22 
GeneralRe: Set Visual Style for an application (and only for it) Pin
Michael Dunn3-Apr-05 11:47
sitebuilderMichael Dunn3-Apr-05 11:47 
Generalcximage code Pin
Lampros Giampouras3-Apr-05 3:37
Lampros Giampouras3-Apr-05 3:37 
GeneralHook and postmessage Pin
Member 6893613-Apr-05 3:17
Member 6893613-Apr-05 3:17 
GeneralRe: Hook and postmessage Pin
dSolariuM3-Apr-05 9:11
dSolariuM3-Apr-05 9:11 
GeneralRe: Hook and postmessage Pin
Anonymous3-Apr-05 19:23
Anonymous3-Apr-05 19:23 
Generalguide for packet sniffer(its urgent) Pin
smarty122-Apr-05 22:30
smarty122-Apr-05 22:30 
GeneralRe: guide for packet sniffer(its urgent) Pin
Antony M Kancidrowski3-Apr-05 1:54
Antony M Kancidrowski3-Apr-05 1:54 
QuestionMFC : OnCtlColor causes problems for combo box? Pin
gregshukla2-Apr-05 22:24
gregshukla2-Apr-05 22:24 
AnswerRe: MFC : OnCtlColor causes problems for combo box? Pin
gregshukla3-Apr-05 0:05
gregshukla3-Apr-05 0:05 
AnswerRe: MFC : OnCtlColor causes problems for combo box? Pin
Anonymous3-Apr-05 0:51
Anonymous3-Apr-05 0:51 
Generalpacket sniffer using vc++ Pin
smarty122-Apr-05 17:55
smarty122-Apr-05 17:55 
GeneralRe: packet sniffer using vc++ Pin
ThatsAlok2-Apr-05 18:01
ThatsAlok2-Apr-05 18:01 
Generaleasy algorythm problem Pin
Anonymous2-Apr-05 17:15
Anonymous2-Apr-05 17:15 

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.