|
HI all,
I am trying to replace FreeImage Libraries with JPEG Package in my VC++ MFC Code.
Where i can refer JPEG Package ?
Is it a free Package ? If so, where can i download ?
Kindly suggest me.
Karthik M
|
|
|
|
|
Gooooooooooogle search.
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
im trying to overwrite the date in flex grid on runtime,(the data was initially written on complie time). please help me out
i am unable to do it....
also send me ur answers on following.....
mansoor_yahya@yahoo.com
{I c E}
|
|
|
|
|
Dear all,
I have .html file and i want to show the file contents on the dialogbox as error messages/ warning messages in formated way. How to implement this?
thanks in advance
Regards,
aj
|
|
|
|
|
I think you can use the WebBrowser ActiveX control. Go to dialog editor, right-click on dialog, select Insert ActiveX Control, and then select Microsoft Web Browser.
Then create a control variable for this new control.
Next call Navigate2 member function in this manner:
_bstr_t urll1(_T("file://path-to-your-html-file"));
_variant_t url2 = url1;
m_cMyControl.Navigate2(&url2, NULL, NULL, NULL, NULL);
Alternatively, you can format a nice message using some editor (like Write) and save as RTF file or resource. Then load this content to a rich-edit control (CRichEditCtrl ).
I hope this helps.
|
|
|
|
|
See ShowHTMLDialog or IHostDialogHelper .
Steve
|
|
|
|
|
i have a bitmap image on my hard drive.i want to display this imag eon my dialog button control.
how to do it?
thanx
|
|
|
|
|
CBitmapButton and see Here[^]
whitesky
|
|
|
|
|
i know that but i don't how to load existing image in it.
|
|
|
|
|
<br />
CBitmapButton m;<br />
m.LoadBitmaps(nIDinResourcefile,..)<br />
you can see example in MSDN
whitesky
|
|
|
|
|
Please stop! The OP said: "i have a bitmap image on my hard drive"
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
Not problem LoadImage SetBitmap
whitesky
|
|
|
|
|
i think its better
<br />
CBitmapButton m_BitmapButton;<br />
m_BitmapButton.Create("Test",BS_BITMAP|WS_CHILD|WS_VISIBLE,CRect(0,40,150,63),this,1);<br />
m_BitmapButton.SetBitmap((HBITMAP)LoadImage(NULL,"c:\\0.bmp",IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE|LR_CREATEDIBSECTION));<br />
whitesky
|
|
|
|
|
Sincerely, I don't think it's better.
Let's go back to C++ and MFC basics:
CBitmapButton is derived from CButton. You have created a CBitmapButton object and call a CBitmap function (CBitmap::SetBitmap) which CBitmapButton, of course, inherits.
Once you don't use any of CBitmapButton added functionality, what's better?
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
oh no its better for show SetBitmap and LoadImage (only)not its better use CBitmapButton instead CButton ok,
whitesky
|
|
|
|
|
You have to:
- be sure the button has BS_BITMAP style; you can do this in the resource editor or by calling ModifyStyle.
- call ::LoadImage Windows API function to load the bitmap fromthe file
- call CButton::SetBitmap
Here is an example:
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
LoadButtonBitmapImage(IDC_BUTTON3, _T("c:\\mybutton.bmp"));
}
void CMyDialog::LoadButtonBitmapImage(UINT nButtonResID,
LPCTSTR pszBitmapFile)
{
CButton* pButton = (CButton*)GetDlgItem(nButtonResID);
pButton->ModifyStyle(BS_ICON, BS_BITMAP);
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL,
pszBitmapFile,
IMAGE_BITMAP, 0, 0,
LR_DEFAULTCOLOR|LR_LOADFROMFILE);
pButton->SetBitmap(hBitmap);
}
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
hello
i did like this
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
LoadButtonBitmapImage(IDC_BUTTON1, _T("C:\Documents and Settings\swaraj\Desktop\sipXezPhone\res\1_down.bmp"));
}
and
void CNewProjectDlg::LoadButtonBitmapImage(UINT nButtonResID,LPCTSTR pszBitmapFile)
{
CButton* pButton = (CButton*)GetDlgItem(IDC_BUTTON1); // be sure the button has BS_BITMAP style
pButton->ModifyStyle(BS_ICON, BS_BITMAP);
// load bitmap from file
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL,pszBitmapFile,IMAGE_BITMAP, 0, 0,LR_DEFAULTCOLOR|LR_LOADFROMFILE);
// set the button bitmap
pButton->SetBitmap(hBitmap);
}
but it not showing me anything..
one thing more i'm getting where from the value will pass into
UINT nButtonResID,LPCTSTR pszBitmapFile
plz tell me the solution.....where i'm amking mistake
byee
|
|
|
|
|
See my post to Mr ovidiucucu i think it work
C:\Documents and Settings\swaraj\Desktop\sipXezPhone\res\1_down.bmp
C:\\Documents and Settings\\swaraj\\Desktop\\sipXezPhone\\res\\1_down.bmp
whitesky
|
|
|
|
|
i Tried it like this but its not displaying any image......
i don't know why? where i'm making mistakes
|
|
|
|
|
Do you check this problem
C:\Documents and Settings\swaraj\Desktop\sipXezPhone\res\1_down.bmp
to
C:\\Documents and Settings\\swaraj\\Desktop\\sipXezPhone\\res\\1_down.bmp
and are you sure path is valid
whitesky
|
|
|
|
|
That should not even compile.
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
hello Sir
thank u very Much....
it working
u r great..........
thanx once again.......sir but i'm not getting the solution of my previous problem yet.....
what to do for it.....
My PM will not allowed me to send u a whole project plz sir if possible then send me some solution.
thanx
|
|
|
|
|
- somehow you have alread set the BS_OVNERDRAW style for the button? Remove it from resource editor or to be sure anyway change ModifyStyle function like this
pButton->ModifyStyle(BS_ICON|BS_OWNERDRAW, BS_BITMAP);
- be sure the full-path-and-file-name (pszBitmapFile) is correct. Anyhow, check the returned value of LoadImage. If something goes wrong then it returns NULL:
if(NULL == hBitmap)
{
DWORD dwError = GetLastError();
}
- be sure IDC_BUTTON1 is indeed the ID of your button control; also verify in resource.h file if you have unique IDs.
AFAIK, more like that cannot happen. Well, we'll see...
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
hello
thanx its working now..
i have one another problem.....when i call a function with in a function it give me a error
"error C2352: 'sipxmngr::handleCallStateEvent' : illegal call of non-static member function"
why is this happenning.
thanx
|
|
|
|
|
hi
it was working with single image but
i want to display two different images in two different buttons.
when i use the code it always showing the same image in both of the buton while the images are different..
i have used follwing code in Oninidialog()
<br />
<br />
LoadButtonBitmapImage(IDC_BUTTON2, _T("D:\\Swaraj Sir PC Data\\SwPhone\\SwPhone\\TeletikPhone\\images\\1.bmp"));<br />
<br />
LoadButtonBitmapImage(IDC_BUTTON3, _T("D:\\Swaraj Sir PC Data\\SwPhone\\SwPhone\\TeletikPhone\\images\\2.bmp"));<br />
and following code use the function;
void sipxmngr::LoadButtonBitmapImage(UINT nButtonResID,LPCTSTR pszBitmapFile)<br />
{ <br />
<br />
CButton* pButton = (CButton*)GetDlgItem(IDC_BUTTON2);
<br />
pButton->ModifyStyle(BS_ICON, BS_BITMAP); <br />
<br />
<br />
HBITMAP hBitmap = (HBITMAP)::LoadImage(NULL,pszBitmapFile,IMAGE_BITMAP, 0, 0,LR_DEFAULTCOLOR|LR_LOADFROMFILE); <br />
<br />
<br />
pButton->SetBitmap(hBitmap);<br />
<br />
CButton* pButton1 = (CButton*)GetDlgItem(IDC_BUTTON3);
<br />
pButton1->ModifyStyle(BS_ICON, BS_BITMAP); <br />
<br />
HBITMAP hBitmap1 = (HBITMAP)::LoadImage(NULL,pszBitmapFile,IMAGE_BITMAP, 0, 0,LR_DEFAULTCOLOR|LR_LOADFROMFILE); <br />
pButton1->SetBitmap(hBitmap1);<br />
<br />
}
it always show me the same image where i'm making mistake..plz tell me
thanx
|
|
|
|