Solved

Storing image useing hDC

Posted on 1998-11-17
4
255 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

829 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