| View previous topic :: View next topic |
| Author |
Message |
Grumps Guest
|
Posted: Fri Apr 29, 2005 3:33 pm Post subject: Save as JPG |
|
|
Hi All
I'm pretty new to c programming, and have a little question.
I'm writing a web-cam application (it's a very long story, but my 'normal'
web-cam software will not work with my capture card).
I have a timer running which will grab a single frame, and then FTP it to my
web-site. This works reliably, but I'm using capFileSaveDIB which produces a
bmp file. Is there an easy way to convert to (or save as) a jpg ?
TIA
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Apr 29, 2005 6:18 pm Post subject: Re: Save as JPG |
|
|
"Grumps" <grumpsnothere (AT) hotmail (DOT) com> wrote
| Quote: | Is there an easy way to convert to (or save as) a jpg ?
|
Load the DIB into a TBitmap and then Assign() it to a TJPEGImage. For
example:
if( capFileSaveDIB(hCapWnd, "c:\folder\file.bmp") )
{
Graphics::TBitmap *bmp = new Graphics::TBitmap;
try
{
bmp->LoadFromFile("c:\folder\file.bmp");
TJPEGImage *jpg = new TJPEGImage;
try
{
jpg->Assign(bmp);
jpg->SaveToFile("c:\folder\file.jpg");
}
__finally {
delete jpg;
}
}
__finally {
delete bmp;
}
}
Gambit
|
|
| Back to top |
|
 |
Grumps Guest
|
Posted: Fri Apr 29, 2005 6:43 pm Post subject: Re: Save as JPG |
|
|
"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote
| Quote: |
"Grumps" <grumpsnothere (AT) hotmail (DOT) com> wrote in message
news:42725416 (AT) newsgroups (DOT) borland.com...
Is there an easy way to convert to (or save as) a jpg ?
Load the DIB into a TBitmap and then Assign() it to a TJPEGImage. For
example:
if( capFileSaveDIB(hCapWnd, "c:\folder\file.bmp") )
{
Graphics::TBitmap *bmp = new Graphics::TBitmap;
try
{
bmp->LoadFromFile("c:\folder\file.bmp");
TJPEGImage *jpg = new TJPEGImage;
try
{
jpg->Assign(bmp);
jpg->SaveToFile("c:\folder\file.jpg");
}
__finally {
delete jpg;
}
}
__finally {
delete bmp;
}
}
|
Thanks.
Just what I needed.
|
|
| Back to top |
|
 |
|