|
I am able to save it in JPG format but the size of the file is somewhere around 150KB. Is there any way I can Optimize the size to somewhere below 100KB as it needs to be sent to the server for real time monitoring.
Thanks In Advance
|
|
|
|
|
Use GDI+ to save to JPG. Once you have a HBITMAP containing the screenshot do Something like this (can't remember the correct objects/methods now so you will have to look them up, but it generally goes something like this):
Gdiplus::Bitmap Img;
Img.Attach(hbitmap_screenshot);
Img.Save(path_to_save_to, Gdiplus::ImageFormatJPEG);
Img.Detach();
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Thanks Its Working
|
|
|
|
|
you can use CxImage class.CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images
|
|
|
|
|
Hi,
I am moving project from MS Visual studio 7.1 to 8.0, in this I am facing problems in building DLL. Many projects get build successfully but while building one project compiler throws error as
"c:\program files\microsoft visual studio 8\vc\atlmfc\include\afx.h(24) : fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d]"
I didn't get how to solve this problem.
compiler throws this error only when building debug DLL and not in release DLL.
Please help me......
|
|
|
|
|
I don't know VS8.0, we're still using 7.x, but to me it looks like you are trying to link to MFC staticly but to CRT dinamycally and it doesn't like that. Does that make sense?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
But in case of release build compiler doesn't gives errors .....
What reason would be behind this....??
|
|
|
|
|
You have different settings for different targets? You can setup things so your debug builds use dynamic and your release builds use static linking or the other way around. Sometimes it happens that someone makes changes to the project settings but forgets to make those to all targets and only applies them to the currently set one and then when others try to build the release, bang, problem. I know it has happened to us a few times too, like i added additional include folders to the debug target but forgot to add them to the release target so when others tried to build the release, multiple "no such file or directoy"s. Fun.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
I want to use varibale across multiple files. If the varibale is updated in one file its value should be visible from other file
how to achieve it ?
i tried static variable , extern could not solve my problem ..
Does Anyone have any idea
Sachin
Edit/Delete Message
|
|
|
|
|
sachin_chakote wrote: I want to use varibale across multiple files. If the varibale is updated in one file its value should be visible from other file
Your requirements define a global variable.
sachin_chakote wrote: i tried static variable
With no luck, I suppose...
sachin_chakote wrote: extern could not solve my problem ..
Actually extern will solve your problem, for instance, declare it extern in a common included header, say commonheader.h :
extern int g_iMyCounter;
Then define it inside only one source file, for instance
int g_iMyCounter;
Finally include commonheader.h in whathever source file needs such variable, for instance
#include "commonheader.h"
int incrementMyCounter()
{
return ++g_iMyCounter;
}
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
[My articles]
|
|
|
|
|
sachin_chakote wrote: i tried static variable , extern could not solve my problem ..
The purpoue of extern is to solve this situation. Check out this link[^].
Well, I recommend to go for a singleton class[^] with name CGlobalData [according to your choice], and make all your required global variables as its members. Then you could access your singleton class from all cpp files and can access the global data as well. Its more object oriented and more easier to maintain than global variables.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi all,
what can i use for coversion of long to CString.
i m try this.
it is right
<br />
long num=0;<br />
CString str=_T("");<br />
str.Format("%2d",num);<br />
thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
|
You could use itoa()[^] as well.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Your solution should work in environments where an 'int' is 4-bytes (=equivalent to 'long').
str.Format("%ld",num);<br /> should work everywhere (the 'l'-prefix indicates that 'num' is a long decimal).
|
|
|
|
|
So please tell me what can i use that is use everywhere.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi all,
i've notice that InternetGetCookie API doesn't work with firefox...
firefox store the cookie differently and even under different location
can any1 help me on how to read values from firefox cookies?
thanks in advanced
Yaron
Interface basics click here :
http://www.codeproject.com/com/COMBasics.asp
don't forget to vote
|
|
|
|
|
I have created Property Sheet and Pages using Win32 SDK. Now I need to modify a edit box on a Page. The piece of code is
HWND hPropSheet = GetActiveWindow();
HWND hPropPage0=PropSheet_GetCurrentPageHwnd(hDlg);
SetDlgItemText(hPropPage0,IDC_EDIT1,(LPCWSTR)szBuffer);
Is this correct? I am not able to get the Handle to window to the Property Sheet ..... Please help
|
|
|
|
|
koumodaki wrote: HWND hPropPage0=PropSheet_GetCurrentPageHwnd(hDlg);
What is hDlg ?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Oops my bad.
its
HWND hPropPage0=PropSheet_GetCurrentPageHwnd(hPropSheet );
Sorry for the confusion.
|
|
|
|
|
HI,
How do i read a Tree.I need to read the Tree from Root Item to all its childs.Iam not able to give logic. Plz help me
Thanks,
|
|
|
|
|
Did you see CTreeCtrl::GetRootItem/GetNextItem/GetSelectedItem?
|
|
|
|
|
Hi all,
I want to get my hard disk name I am using WMI to get it. I have Initialized com using CoInitializeEx, then i have set security levels using CoInitializeSecurity, then i Obtain the initial locator to WMI, then i have Connected to WMI through the IWbemLocator::ConnectServer method but my problem is i am not getting the right api to get hard disk name.. how can i get it???
IWbemServices *pSvc = NULL;
hres = pLoc->ConnectServer(
_bstr_t(L"ROOT\\CIMV2"),
NULL,
NULL,
0,
NULL,
0,
0,
&pSvc
);
can anybody help me in this
thanks in advance
|
|
|
|
|
First of all Set IWbemServices proxy security so that WMI service can impersonate the client by calling CoSetProxyBlanket.
Then Get Physical disks Installed on the system using ExecQuery().
|
|
|
|
|
can u tell me this through some example, or can u provide me with some link
|
|
|
|