Solved

Storing image useing hDC

Posted on 1998-11-17
4
248 Views
Last Modified: 2010-04-04
 How to use hDC(and what is hDC) to store big image?
I'm doing graphics editor.
0
Comment
Question by:jack_p50
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Thaddy
ID: 1347110
hDC means 'Handle' to a 'Device Context'
0
 
LVL 4

Accepted Solution

by:
BoRiS earned 30 total points
ID: 1347111
jack_p50

Thaddy is totally right on the meaning and here is an example on how to use it this does a simple screen capture and dumps it on to the forms canvas..

unit scrcap;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Buttons, ExtCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    SpeedButton1: TSpeedButton;
    procedure SpeedButton1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.SpeedButton1Click(Sender: TObject);
var
  ScreenDC : HDC;
begin
  ScreenDC:=CreateDC('DISPLAY',nil,nil,nil);
  BitBlt(Image1.Canvas.Handle, 0,0, Image1.Width, Image1.Height,
  ScreenDC, 0,0, SRCCOPY);
  Image1.Refresh;
  DeleteDC(ScreenDC);
end;

end.

Later
BoRiS
0
 
LVL 4

Author Comment

by:jack_p50
ID: 1347112
Please give me syntax of all hDC-related funtions and procs (i.e. createDC).
Btw, I don't want to use TImage or TBitmap. I need ability to get memory and access
any byte of it.
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1347113
jack_p50

I would give you all the syntax etc that go with HDC but we will be here forever, the best thing to do is open the win32.hlp (API help file) and search for CreateDC it will explain the whole thing to you, as well as give you the procedures that go with CreateDC etc...

Later
BoRiS
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now