Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7041049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:59:29+00:00 2026-05-28T01:59:29+00:00

im working on an application using delphi 6 , where im trying to integrate

  • 0

im working on an application using delphi 6, where im trying to integrate camera into the existing application, the camera code displays the captured frames onto a Tpanel, in my application i need to display the captured frame on Tpaintbox ( i am not the original coder),

this is a code sample from the

  procedure TFrameThreadX.DrawFrame;
    var
    hdc:THandle; 
     begin
       
       //do processing
      .
      . 
       hdc := GetDC( ViewForm.ViewPanel.Handle );
       SetStretchBltMode(hdc,COLORONCOLOR);
       StretchDIBits(hdc,0,0,nW,nH,0,0,ScW,ScH,DibPixels,TBitMapInfo((@FDib)^),DIB_RGB_COLORS,SRCCOPY);
       ReleaseDC( ViewForm.ViewPanel.Handle, hdc );


     //do processing
    end;

here is get the Tpanel handle as 87248682 from this

  hdc := GetDC( ViewForm.ViewPanel.Handle );

so when i try to use Tpaintbox in the code like this

       hdc := GetDC( ViewForm.PaintBox1.Canvas.Handle);

The result is 0,

so the camera frames are not displayed..

so i tried this

using the GetDC and GetWindowDC but in both the cases the result of the functions is 0 for the handle,

enter image description here

my code

   var
     hdc  : THandle;
     begin
       hdc := GetDC(Panel1.Handle);
       Label1.Caption:=inttostr(hdc);
       hdc := GetDC(Image1.Canvas.Handle);
       Label2.Caption:=inttostr(hdc);
       hdc := GetDC(PaintBox1.Canvas.Handle);
       Label3.Caption:=inttostr(hdc);
     end;

And for GetWindowDC

    var
     hdc  : THandle;
     begin
     hdc := GetWindowDC(Panel1.Handle);
     Label4.Caption:=inttostr(hdc);
     hdc := GetWindowDC(Image1.Canvas.Handle);
     Label5.Caption:=inttostr(hdc);
     hdc := GetWindowDC(PaintBox1.Canvas.Handle);
     Label6.Caption:=inttostr(hdc);
    end;

So please tell me how to get the Tpaint handle?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:59:30+00:00Added an answer on May 28, 2026 at 1:59 am

    Canvas.Handle is the DC handle you’re looking for, so HDC := PaintBox1.Canvas.Handle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on a console application using Delphi 7, and have run into a problem.
I'm working in a web application using VB.NET. There is also VisualBasic code mixed
im working on application using delphi 7 , and i just came across this
I'm working on an application using ASP.NET MVC 1.0 and I'm trying to inject
i am working in JSF Application and in this application using some code i
Hi im working on iphone application using monotouch im trying to get list of
I'm currently working on porting an existing Delphi 5 application to Delphi 2010. It's
Im working on an application using Postgres 9 and Delphi 7 as the front
I have a Delphi application which reads data from an excel spreadsheet using code
I am working on window application using c# . i want to show my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.