Click here to Skip to main content
15,914,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralUnicode/MBCS compatibility Pin
DataPrasad11-Dec-01 3:18
DataPrasad11-Dec-01 3:18 
GeneralRe: Unicode/MBCS compatibility Pin
PJ Arends11-Dec-01 9:20
professionalPJ Arends11-Dec-01 9:20 
Generalsnapshot and dynamic recordset! Pin
mazy11-Dec-01 2:59
mazy11-Dec-01 2:59 
GeneralRe: snapshot and dynamic recordset! Pin
Carlos Antollini11-Dec-01 3:10
Carlos Antollini11-Dec-01 3:10 
Generalbeginner question : DocView Pin
Jerome Conus11-Dec-01 2:57
Jerome Conus11-Dec-01 2:57 
GeneralRe: beginner question : DocView Pin
Michael Dunn11-Dec-01 8:02
sitebuilderMichael Dunn11-Dec-01 8:02 
GeneralXP Buttons and Dropdowns Pin
11-Dec-01 2:33
suss11-Dec-01 2:33 
GeneralHollow in MFC. Please help. Pin
The_Server11-Dec-01 1:39
The_Server11-Dec-01 1:39 
Hi, All !!!
=======

Last time I asked: How to grayscale a picture, and didn't got an answer.

Well...
If you guys wanna know how, there is your answer:
I found out that in order to have a gray color,
all Red,Green & Blue must have the same value.
So...

<code>void</code> GrayscaleIt(MyPicture & pic)
{
  for (<code>int</code> y=0; y<pic.height; y++)
    for (<code>int</code> x=0; x<pic.width; x++)
    {
      <code>COLORREF</code> col= pic.GetPixel(x,y);
      <code>unsigned char</code> gs= ((GetRValue(col)+GetGValue(col)+GetBValue(col))/3);
      pic.SetPixel(x,y, RGB(gs,gs,gs));
    }
}


BTW:

I have a question.

After the win32 AppWizard, In order to make my window "transparent" or "hollow",
I need to change the wcex.hbrBackground to 0;
Like this:
ATOM MyRegisterClass(HINSTANCE hInstance)
{
  WNDCLASSEX wcex;

  wcex.cbSize = sizeof(WNDCLASSEX); 

  wcex.style		= 0;//CS_HREDRAW | CS_VREDRAW;
  wcex.lpfnWndProc	= (WNDPROC)WndProc;
  wcex.cbClsExtra	= 0;
  wcex.cbWndExtra	= 0;
  wcex.hInstance	= hInstance;
  wcex.hIcon		= LoadIcon(hInstance, (LPCTSTR)IDI_GRAY1);
  wcex.hCursor		= LoadCursor(NULL, IDC_ARROW);
<code>  wcex.hbrBackground	= NULL;//(HBRUSH)(COLOR_WINDOW+1);</code>
  wcex.lpszMenuName	= NULL;//(LPCSTR)IDC_GRAY1;
  wcex.lpszClassName	= szWindowClass;
  wcex.hIconSm		= LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);

  return RegisterClassEx(&wcex);
}


Cry | :(( How do I do it in MFC ????? Cry | :((

Please, HELP!



BTW: come to #CodeProject on DalNet (mIRC)
GeneralRe: Hollow in MFC. Please help. Pin
Alvaro Mendez11-Dec-01 4:19
Alvaro Mendez11-Dec-01 4:19 
GeneralRe: Hollow in MFC. Please help. Pin
Michael Dunn11-Dec-01 8:04
sitebuilderMichael Dunn11-Dec-01 8:04 
GeneralUsing standard ActiveX (VC++ 6.0) Pin
DABMSC10-Dec-01 23:55
DABMSC10-Dec-01 23:55 
GeneralRe: Using standard ActiveX (VC++ 6.0) Pin
Michael P Butler11-Dec-01 0:21
Michael P Butler11-Dec-01 0:21 
QuestionHow do I change the page layout (page orientation) during printing? Pin
Youknowme10-Dec-01 23:14
Youknowme10-Dec-01 23:14 
AnswerRe: How do I change the page layout (page orientation) during printing? Pin
Bernhard10-Dec-01 23:59
Bernhard10-Dec-01 23:59 
GeneralStupid question answered thousand times Pin
Krouer10-Dec-01 22:51
Krouer10-Dec-01 22:51 
GeneralRe: Stupid question answered thousand times Pin
moliate11-Dec-01 2:09
moliate11-Dec-01 2:09 
General'Pushing' a thread... Pin
Mr.Freeze10-Dec-01 22:38
Mr.Freeze10-Dec-01 22:38 
GeneralRe: 'Pushing' a thread... Pin
Krouer10-Dec-01 22:45
Krouer10-Dec-01 22:45 
GeneralRe: 'Pushing' a thread... Pin
Nish Nishant11-Dec-01 0:38
sitebuilderNish Nishant11-Dec-01 0:38 
GeneralRe: 'Pushing' a thread... Pin
markkuk11-Dec-01 0:52
markkuk11-Dec-01 0:52 
GeneralRe: 'Pushing' a thread... Pin
Michael Dunn11-Dec-01 8:22
sitebuilderMichael Dunn11-Dec-01 8:22 
GeneralRe: 'Pushing' a thread... Pin
Mr.Freeze11-Dec-01 13:35
Mr.Freeze11-Dec-01 13:35 
Generallooking for panacea....how invoke method of Server in a Container Pin
Ahmad9910-Dec-01 22:24
Ahmad9910-Dec-01 22:24 
GeneralCrystal Reports Pin
imrancs_qau10-Dec-01 21:50
imrancs_qau10-Dec-01 21:50 
Questionhow to Run Visual c++ program in another computer that haven't visual c++? Pin
nemati10-Dec-01 21:23
nemati10-Dec-01 21:23 

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.