|
Try libjpeg. It's fairly low level so you should be able to do pretty much anything you need to do with jpegs.
Lib JPEG[^]
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
I would avoid using 3rd party software as much as possible. How difficult it is to write a function to convert a jpeg file to a thumbnail file? I also have a need to convert other image formats to a thumbnail format.
Elizabeth
|
|
|
|
|
It aint worth writing ur own code to do it, plus the jpeg decomp libs are free. Otherwise check out CxImage in codeproject.
Jesus! i am still alive.
|
|
|
|
|
It sounds very helpful. Can you tell me where I find the jpeg library file? I hope there is not much work when I deploy my application to a client machine.
Elizabeth
|
|
|
|
|
Hi there!
I'm trying to "swap" keys on the keyboard.
The main reason is that I want to swap the " with « and »
depending on wether i'm pressing the left or right shift-buttons.
The hook "triggers" whenever I press the correct keys and
a MessageBox appears (I used it for debugging purposes).
Still I have trouble with SendInput and keybd_event.
I get keybd_event to send "A"'s and "B"'s and so on, but NO « and » (ALT 174 and ALT 175) (at least on my keyboard).
It seems that the ascii values are 171 and 187 for those two chars. I've tried to "send" 171 and 187 but still no luck. Is it because the chars are so "high up" in the ascii table?
I've tried SendMessage(GetForegroundWindow(),WM_CHAR,(WPARAM)'«',0) too, with no luck.
Any suggestions anyone?
|
|
|
|
|
I'm need to resolve how to save a HBITMAP to jpeg file.
Someone try???????
// drawing somethings///////////////////////////////////
void CJanelaView::OnGravar() {
CClientDC dc(this); Graphics d(dc);
Pen blue (Color(255, 0, 0, 255));
Pen red (Color(255, 255, 0, 0));
Pen pen (Color(y, 0, 255,0));
Pen pen1 (Color(x, 255, 0, 255));
Pen pen2(Color(255, 255, 0, 255));
for (int x=0,int y=256; x<256; x+=15){ d.DrawLine(&blue,0,y,x,0); d.DrawLine(&red,256,x,y,256); y-=5; }
for (y = 0; y < 256; y++){ d.DrawLine(&pen, 0, y, 256, y); Sleep(20); }
for (x = 0; x < 256; x++){ d.DrawLine(&pen1, x, 100, x, 200); Sleep(20); }
d.DrawRectangle(&pen2,0,0,50,50); Image Im(L"lily.jpg", FALSE); d.DrawImage(&Im,50,50);
// saving the bitmap of screen view////////////////////////////////
HDC bloco = CreateCompatibleDC(dc);
HBITMAP tela = CreateCompatibleBitmap(dc,240,320);
if ( tela==0 || !SelectObject(bloco,tela) || !BitBlt(bloco,0,0,240,320,dc,0,0,SRCCOPY)) return ;
DeleteDC(bloco); DeleteDC(dc);
CLSID GifCodec;
GetCodecClsid(L"image/jpeg", &GifCodec);
tela.Save(L"wrk.jpg", &GifCodec, NULL); // an error occurs
}
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
Hi everyone,
I posted this question earlier today but i didn't get a response. I am a mini jam here, so I decided to ask it again. To the people who read my first post, SORRY!
I need to look into a UDP buffer but just peek at it. I have read that I can use MSG_PEEK with ReceiveFrom, but can I use it was Receive? I use Receive(,,MSGPEEK) with a TCP implementation and it works perfectly. How would I do this in UDP?
Here is what I have;
unsigned int temp;
int rVal = Receive(&temp, sizeof(temp), MSG_PEEK);
if(rVal < 0)
{
int err = GetLastError();
}
else
{
unsigned int RecvBuf;
int rVal2 = Receive(&RecvBuf, sizeof(RecvBuf));
...
}
Any help would be appreciated greatly. If you have code that does this, i would also appreciate that too.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
NewHSKid wrote:
Just cause I am 15...
hmmm... this is a silly slogan, i'm ONLY 17, and i don't use my age for getting pity!
use recvfrom for udp, it will return you the peer's address, so you'll know where the data came from!
Don't try it, just do it!
|
|
|
|
|
No, you don't understand...
These days it works in reverse. I'm 41, have a wife, three kids and an ex-wife.
I'm the one that needs pity....
On the other hand, though, I can often answer questions sensibly in the CP forums, so it ain't all bad...
Steve S
|
|
|
|
|
oh poor steve... it's sooo shattering
Don't try it, just do it!
|
|
|
|
|
Who said that was put there for pity?
That is really in there so that people DON'T talk down to me and like I am an idiot. I don't believe your comment was necessary, considering that it has nothing to do with pity.
Thank you for your help though. I appreciate it.
Jimmy
Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)
|
|
|
|
|
I have a richeditctrl derived class in a dialog. I want to do something i the onClick so I trapped the NM_CLICK for the control through class wizard. But the code never steps into this at all!
Thanks,
ns
|
|
|
|
|
Take a look at at CRichEditCtrl::SetEventMask and ENM_MOUSEEVENTS . For some reason, seems the standard way with NM_CLICK does not apply for rich edit controls.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi!
Using the eventMask and pretranslateMessage with a few tricky flags I was able to get what I wanted!
Many thanks for pointing me in the right direction!
ns
|
|
|
|
|
Try:
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_richedit.SetEventMask(m_richedit.GetEventMask() | ENM_MOUSEEVENTS);
}
void CMyDlg::OnMsgfilterRichedit(NMHDR* pNMHDR, LRESULT* pResult)
{
MSGFILTER *pMsgFilter = reinterpret_cast<MSGFILTER *>(pNMHDR);
if (pMsgFilter->msg == WM_MOUSEACTIVATE)
;
else if (pMsgFilter->msg == WM_LBUTTONDOWN)
;
else if (pMsgFilter->msg == WM_LBUTTONUP)
;
else if (pMsgFilter->msg == WM_MOUSEFIRST)
;
*pResult = 0;
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
That worked too! Many thanks. I have much to learn!
|
|
|
|
|
hello guys, i'm looking for information concerning the checksum algorithms for the cd-rom format(orange book i think).
thank you for any information
Don't try it, just do it!
|
|
|
|
|
Google for "reed-solomon" "compact disc". Regards,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have developed a communications app that has had one unhandled exception error during the past two months of testing. I used Visual C++, and the app is running on Win2K Server. It runs great, no memory leaks, everything looks good. The longest I have let it run so far is for a couple of weeks being hammered with data, and there are not any problems. Once, there was an unhandled exception in debug.lib after it had been running for 4 days. I was hoping to have written a bullet-proof app without any problems. I know that Microsoft and other apps can have an occasional unhandled exception. Does anyone know what could cause this to happen so that I can put it in the analysis of my development folder. I can't duplicate the problem.
|
|
|
|
|
First thing to do is make your application so that it does not exit after an unhandled exception. Put a cach handler in your main application. If it is an MFC application override ProcessWndProcException(CException* e, const MSG* pMsg) in your application class and log the error so if it happens again you may be able to figure out what happened.
LRESULT CCommonAppBase::ProcessWndProcException(CException* e, const MSG* pMsg)
{
if ( e->GetErrorMessage(szError,MAX_PATH) ) {
Log("FATAL ERROR(%s): %s",_T("CCommonAppBase"),szError); }
return CWinApp::ProcessWndProcException(e, pMsg);
}
Override PumpMessage() and call CWinApp::PumpMessage(); inside a try catch block.
BOOL CCommonAppBase::PumpMessage()
{
BOOL retVal = TRUE;
try {
retVal = CWinApp::PumpMessage();
}
catch(CException* e) {
TCHAR szError[MAX_PATH];
if ( e->GetErrorMessage(szError,MAX_PATH) ) {
Log("FATAL ERROR(%s): %s",_T("CCommonAppBase"),szError);
}
e->Delete();
}
catch(...){
}
return retVal;
}
Use SEH and C++ Exceptions - catch all in one http://www.codetools.com/cpp/seexception.asp[^]. And activate it in your ::InitInstance().
BOOL CCommonAppBase::InitInstance()
{
_set_se_translator(SeTranslator);
return CWinApp::InitInstance();
}
John
|
|
|
|
|
The problem is simple:
I need to launch the default mail client (mailto: won't help here), open a new message and add some attachments to it. I need to do the same as when the user right-clicks a file and selects "Send to->Mail recipient". I need a solution that works for all mail clients and not just Outlook... and I need it quickly :/
|
|
|
|
|
Have you considered MAPI?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I don't know much about MAPI, but from what I've seen it does not support launching the mail client. There seem to be some interfaces which support this, though I can't invest that much time. I also haven't found any examples which use these interfaces, so digging through all the MSDN articles uses way too much time.
|
|
|
|
|
Tak wrote:
I don't know much about MAPI, but from what I've seen it does not support launching the mail client.
While it may not "launch" the default mail client in the true sense of the word, it is still the mail API, and, unless you know otherwise, is used by the default mail client. I am only familiar with a few mail clients, and they use MAPI. Outlook uses CDO, which is simply a COM wrapper around MAPI.
Tak wrote:
...I can't invest that much time...digging through all the MSDN articles uses way too much time.
It is, however, time well spent.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
First, even if the time might be well spent, I don't _have_ the time. Second, the mail client has to pop up, I don't want to just send a mail. It's not in my hands, it's the customer who wants it like this
Though I looked a bit deeper into the MAPI and saw that you can launch the GUI; I just hope that it works with their strange mail client...
|
|
|
|
|