Solved

Storing image useing hDC

Posted on 1998-11-17
4
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

724 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