🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.multimedia
Article #516

WebCam Capture, BMP resize problem.

#516
From: Edward
Date: Thu, 27 Nov 2003 18:50
63 lines
2339 bytes
Hi all

    I using my code above to capture a imagem direct from my web cam and
save into a BMP file but i need to resize the image and when i do that i
have some problems i dont know what is happening.

    In the future the program will be hinding from user so i cant show the
FROM.

Thanks

Edward



  CAPSTATUS CapStatus;
  char str[12];

  TimerRefresh->Enabled = false;
  if(!FileExists("SAIR.DAT"))
  {
    if(ctImg>=20)
    {
      ctImg=0;
    }
    ctImg++;
    sprintf(str,"web%03d.bmp",ctImg);

    try
    {
      capGetStatus(hWndC, &CapStatus, sizeof (CAPSTATUS));
      capFileSaveDIB(hWndC, str);

      Graphics::TBitmap *bmpOld = new Graphics::TBitmap();
      Graphics::TBitmap *bmpNew = new Graphics::TBitmap();

      bmpOld->LoadFromFile(str);
      bmpNew->Width = tamXVL;
      bmpNew->Height = tamYVL;
      bmpNew->Canvas->StretchDraw(bmpNew->Canvas->ClipRect, bmpOld);

      bmpNew->Assign(bmpNew);
      bmpNew->SaveToFile(str);

      delete bmpOld;
      delete bmpNew;

    }
    catch (Exception &Ex)
    {
      MessageDlg("Exception type " + Ex.ClassName() + " returned error
message: " + Ex.Message + "\r" + " in form " + this->ClassName(), mtError,
TMsgDlgButtons() << mbOK, 0);
      abort();
    }
  }
  else
  {
    capDriverDisconnect(hWndC);
    FreeLibrary(AVICapDllHandle);
    Close();
  }
  TimerRefresh->Enabled = true;
Technical Details
Message-ID: <3fc6476a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d0fc,f3d9d5312ab89140,start
X-Google-Attributes: gid10d0fc,public
X-Google-ArrivalTime: 2003-11-27 11:10:35 PST
Reply-To: "Edward" <registrados@via-rs.net>
From: "Edward" <registrados@via-rs.net>
Newsgroups: borland.public.cppbuilder.multimedia
Subject: WebCam Capture, BMP resize problem.
Date: Thu, 27 Nov 2003 16:50:02 -0200
Lines: 65
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 200.198.155.216
Message-ID: <3fc6476a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069959018 200.198.155.216 (27 Nov 2003 10:50:18 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail