Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to copy a bitmap, picture or metafile from the clipboard? Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
Copy a bitmap, picture or metafile from the clipboard? 07-Apr-03
Category
Win API
Language
Delphi 3.x
Views
145
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			 Author: Maarten de Haan

How to copy a bitmap, picture or metafile from the clipboard?

Answer:

1   var
2     bmp: TBitmap;
3     pic: TPicture;
4   
5   begin
6     bmp := TBitmap.Create;
7   
8     // PICTURE OR METAFILE
9     if (ClipBoard.HasFormat(CF_PICTURE)) or
10      (ClipBoard.HasFormat(CF_METAFILEPICT)) then
11    begin
12      pic := TPicture.Create;
13      pic.Assign(ClipBoard);
14      X := pic.Width;
15      Y := pic.Height;
16      bmp.Width := X;
17      bmp.Height := Y;
18      bmp.Canvas.Draw(0, 0, pic.Graphic);
19      pic.Free;
20    end;
21  
22    // BITMAP
23    if (ClipBoard.HasFormat(CF_BITMAP)) then
24    begin
25      bmp.Assign(ClipBoard);
26    end;
27    // Bitmap, picture or metafile is now in bmp
28    // When used free bmp!
29  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC