|
Why you dont use of CBitmapButton?
|
|
|
|
|
I did but the bitmap buttons don't appear either.
I m puzzled.
Ema
|
|
|
|
|
|
I created the owner drawn bitmap buttons on my main dialog form. It appears just fine.
But when I use exactly the same method for my other dialog forms in the same project,
the bitmap buttons are not appearing.Strange.I am puzzled.I've no idea what I have missed out
that i should have included.
Ema
|
|
|
|
|
Did you set owner draw for other buttons?
|
|
|
|
|
Yes,I did set the owner draw attribute.
Ema
|
|
|
|
|
|
Here it goes:
>>>In *.h file:
protected:
CBitmapButton m_bmresultsButton;
// Generated message map functions
//{{AFX_MSG(CResultsDialog)
virtual BOOL OnInitDialog();
>>>In *.cpp file :
BOOL CResultsDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_bmresultsButton. AutoLoad(IDC_BUTTON_BITMAP105, this);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
>>>In Resource.h file:
#define IDC_BUTTON_BITMAP105 11181
Ema
|
|
|
|
|
Ok Ema check this code:
#include AtlImage.h
CImage m_Image;
m_Button.Create(_T(""),WS_CHILD|WS_VISIBLE,CRect(0,0,100,23),this,idc_button);
m_Image.Load(_T("c:\\1.jpg"));
m_Button.ModifyStyle(0,BS_BITMAP);
m_Button.SetBitmap(m_Image.Detach());
|
|
|
|
|
When I try to include the ATL's supporting header files, I get too many errors.
Because my project previously doesn't cater for ATL.
Ema
|
|
|
|
|
Not problem you can test this code with LoadImage,but you need to use of bmp files with LoadImage and told me whats happenning when run this code?
|
|
|
|
|
|
hhmmm....just as an additional info...how to display the histogram of the image using the visual C++ (MFC)?
|
|
|
|
|
hi all! i have a problem. i have a number of 31 digits and i want to divide it to a number of 2 digits
|
|
|
|
|
ok.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
You may write your own routine to the purpose or you can use a library such GMP ^ .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
so what is the problem, you looking for algorithm?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I am changing certain registry keys using VC++ and after that I want to refresh explorer. I have tried following two ways but none of them works under vista.
1. SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);<br />
2. SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_NORMAL, 1000);
Is there some other way to refresh explorer under vista?
-Saurabh
|
|
|
|
|
Hi all,
i have coded one 8 KHz 16 Bit PCM audio with ITU's G.729A codec. now i want Media player to run the coded file. I'll be really thankful if somebody helps me filling WAVEFORMATEX structure so that RIFF header can be append with the coded file.
Thanks
|
|
|
|
|
Hi,
I have some application that i wrote as doc/view architecture.
In this application i pop up some child window using DoModal.
The child windows is up and the application need to ignore all the action that i doing on the main window ( because of the doModal of the child window ).
But - actually - when i try to minimize the main window i find out that the application not ignoring the minimize command and the application is minimize.
How its can be ? how can i solve this problem ?
P.S: the minimize is done by doing a lot of clicking on the minimize button on the title bar. If clicking only once - nothing happened.
Thanks.
|
|
|
|
|
I am not sure but, I think It could be a reason some time main window is getting the message while the modal dialog not getting.
May be very rare.
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Its obvious that the main window got some message - but how its can be ? and how it can be solved ?
|
|
|
|
|
|
umai wrote: however i got problem to do the looping as my lecturer want me to...can anyone teach me how to do it?
Please detail your problem: what exactly do you need to accomplish and what is your trouble about?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
//////////////////////////////RGB CHANGE TO GREY SCALE COLOR/////////////////////////
for(x=X_START;x<=X_END;x+=X_SKIP) //ORIGINAL IMAGE SIZE-X AXIS
{
for(y=Y_START_SE;y<=Y_END_SE;y+=Y_SKIP) //SELECTED SCAN AREA-Y AXIS(FR ORI SIZE)
{
color=pDC->GetPixel(x,y);
m = 0.5*x;
n = 0.5*y;
r_image[m][n] = GetRValue(color);
g_image[m][n] = GetGValue(color);
b_image[m][n] = GetBValue(color);
brightness_image[m][n] = ((222*r_image[m][n]+707*g_image[m][n]+71*b_image[m][n])/1000);
if(brightness_image[m][n]<0)
brightness_image[m][n] = 0;
if(brightness_image[m][n]>255)
brightness_image[m][n] = 255;
Haugh_image[m][n]=0;//Haugh_image INITIALIZATION
}
}
for(x=X_START;x<=X_END;x+=X_SKIP) //ORIGINAL IMAGE SIZE-X AXIS
{
for(y=Y_START_SE2;y<=Y_END_SE2;y+=Y_SKIP) //SELECTED SCAN AREA-Y AXIS(FR ORI SIZE)
{
color=pDC->GetPixel(x,y);
m = 0.5*x;
n = 0.5*y;
r_image[m][n] = GetRValue(color);
g_image[m][n] = GetGValue(color);
b_image[m][n] = GetBValue(color);
brightness_image[m][n] = ((222*r_image[m][n]+707*g_image[m][n]+71*b_image[m][n])/1000);
if(brightness_image[m][n]<0)
brightness_image[m][n] = 0;
if(brightness_image[m][n]>255)
brightness_image[m][n] = 255;
Haugh_image[m][n]=0;//Haugh_image INITIALIZATION
}
}
//////////////////EDGE DETACTION BY SOBEL FILTER & DENSITY CONVERSION///////////////////
//UPPER LEFT AREA
for(x=X_START_L1+1;x<=X_END_L1-1;x++)
{
for(y=Y_START_TH+1;y<=Y_END_TH-1;y++)
{
d[0]=brightness_image[x-1][y-1];
d[1]=brightness_image[x-1][y];
d[2]=brightness_image[x-1][y+1];
d[3]=brightness_image[x][y-1];
d[4]=brightness_image[x][y];
d[5]=brightness_image[x][y+1];
d[6]=brightness_image[x+1][y-1];
d[7]=brightness_image[x+1][y];
d[8]=brightness_image[x+1][y+1];
yyy=(float)(cy[0]*d[0] + cy[1]*d[1] + cy[2]*d[2] +cy[3]*d[3] +cy[4]*d[4] +cy[5]*d[5] +cy[6]*d[6] + cy[7]*d[7] + cy[8]*d[8]);
zzz=(float)(sqrt(yyy*yyy));
dat=(int)zzz;
if(dat>255) dat= 255;
sobel_image[x][y] = 255-(char)dat;
a = sobel_image[x][y];
pDC->SetPixel(x,y,RGB(a,a,a));
}
}
//UPPER RIGHT AREA
for(x=X_START_R1+1;x<=X_END_R1-1;x++)
{
for(y=Y_START_TH+1;y<=Y_END_TH-1;y++)
{
d[0]=brightness_image[x-1][y-1];
d[1]=brightness_image[x-1][y];
d[2]=brightness_image[x-1][y+1];
d[3]=brightness_image[x][y-1];
d[4]=brightness_image[x][y];
d[5]=brightness_image[x][y+1];
d[6]=brightness_image[x+1][y-1];
d[7]=brightness_image[x+1][y];
d[8]=brightness_image[x+1][y+1];
yyy=(float)(cy[0]*d[0] + cy[1]*d[1] + cy[2]*d[2] +cy[3]*d[3] +cy[4]*d[4] +cy[5]*d[5] +cy[6]*d[6] + cy[7]*d[7] + cy[8]*d[8]);
zzz=(float)(sqrt(yyy*yyy));
dat=(int)zzz;
if(dat>255) dat= 255;
sobel_image[x][y] = 255-(char)dat;
a = sobel_image[x][y];
pDC->SetPixel(x,y,RGB(a,a,a));
}
}
//LOWER LEFT AREA
for(x=X_START_L2+1;x<=X_END_L2-1;x++)
{
for(y=Y_START_TH2+1;y<=Y_END_TH2-1;y++)
{
d[0]=brightness_image[x-1][y-1];
d[1]=brightness_image[x-1][y];
d[2]=brightness_image[x-1][y+1];
d[3]=brightness_image[x][y-1];
d[4]=brightness_image[x][y];
d[5]=brightness_image[x][y+1];
d[6]=brightness_image[x+1][y-1];
d[7]=brightness_image[x+1][y];
d[8]=brightness_image[x+1][y+1];
yyy=(float)(cy[0]*d[0] + cy[1]*d[1] + cy[2]*d[2] +cy[3]*d[3] +cy[4]*d[4] +cy[5]*d[5] +cy[6]*d[6] + cy[7]*d[7] + cy[8]*d[8]);
zzz=(float)(sqrt(yyy*yyy));
dat=(int)zzz;
if(dat>255) dat= 255;
sobel_image[x][y] = 255-(char)dat;
a = sobel_image[x][y];
pDC->SetPixel(x,y,RGB(a,a,a));
}
}
//LOWER RIGHT AREA
for(x=X_START_R2+1;x<=X_END_R2-1;x++)
{
for(y=Y_START_TH2+1;y<=Y_END_TH2-1;y++)
{
d[0]=brightness_image[x-1][y-1];
d[1]=brightness_image[x-1][y];
d[2]=brightness_image[x-1][y+1];
d[3]=brightness_image[x][y-1];
d[4]=brightness_image[x][y];
d[5]=brightness_image[x][y+1];
d[6]=brightness_image[x+1][y-1];
d[7]=brightness_image[x+1][y];
d[8]=brightness_image[x+1][y+1];
yyy=(float)(cy[0]*d[0] + cy[1]*d[1] + cy[2]*d[2] +cy[3]*d[3] +cy[4]*d[4] +cy[5]*d[5] +cy[6]*d[6] + cy[7]*d[7] + cy[8]*d[8]);
zzz=(float)(sqrt(yyy*yyy));
dat=(int)zzz;
if(dat>255) dat= 255;
sobel_image[x][y] = 255-(char)dat;
a = sobel_image[x][y];
pDC->SetPixel(x,y,RGB(a,a,a));
}
}
this is the programming for the image conversion...let say, i want to create a loop for this command...how i want to do it?
|
|
|
|