日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

java中qq中拉伸的文件,delphi中如何实现QQ中的截图并实现拉伸放大移动的功能

發布時間:2024/9/19 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java中qq中拉伸的文件,delphi中如何实现QQ中的截图并实现拉伸放大移动的功能 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

你按下截圖按鈕的時候,其實看到的不是真正的桌面了,是程序把桌面的圖片截下來畫在一個全屏的窗口上.

我寫個小程序給你參考一下。

unit?unMainFrm;

interface

uses

Windows,?Messages,?SysUtils,?Variants,?Classes,?Graphics,?Controls,?Forms,

Dialogs,?ExtCtrls,?StdCtrls;

type

TScreenCanvas?=?class(TCanvas)

protected

procedure?CreateHandle;?override;

public

destructor?Destroy;?override;

end;

TForm2?=?class(TForm)

procedure?FormMouseDown(Sender:?TObject;?Button:?TMouseButton;

Shift:?TShiftState;?X,?Y:?Integer);

procedure?FormMouseUp(Sender:?TObject;?Button:?TMouseButton;

Shift:?TShiftState;?X,?Y:?Integer);

procedure?FormMouseMove(Sender:?TObject;?Shift:?TShiftState;?X,?Y:?Integer);

procedure?FormCreate(Sender:?TObject);

procedure?FormPaint(Sender:?TObject);

procedure?FormKeyDown(Sender:?TObject;?var?Key:?Word;?Shift:?TShiftState);

private

{?Private?declarations?}

FBitMap:?TBitmap;

FScreenCanvas:?TScreenCanvas;

FDrawEnable:?Boolean;

public

{?Public?declarations?}

end;

var

Form2:?TForm2;

implementation

{$R?*.dfm}

procedure?TForm2.FormCreate(Sender:?TObject);

begin

FBitMap?:=?TBitmap.Create;

with?FBitMap?do

begin

Width?:=?1024;

Height?:=?768;

end;

FScreenCanvas?:=?TScreenCanvas.Create;

FBitMap.Canvas.CopyRect(Rect(0,0,1024,768),?FScreenCanvas,?Rect(0,0,1024,768));

end;

procedure?TForm2.FormKeyDown(Sender:?TObject;?var?Key:?Word;

Shift:?TShiftState);

begin

if?Key?=?VK_ESCAPE?then

Application.Terminate;

if?Key?=?VK_CONTROL?then

begin

Canvas.FillRect(Canvas.ClipRect);

Invalidate;

end;

end;

procedure?TForm2.FormMouseDown(Sender:?TObject;?Button:?TMouseButton;

Shift:?TShiftState;?X,?Y:?Integer);

begin

FDrawEnable?:=?True;

Randomize;

Canvas.Brush.Color?:=?Random($FFFFFF?+?1);

Ellipse(Canvas.Handle,?X?-?5,?Y?-?5,?X?+?5,?Y?+?5);

end;

procedure?TForm2.FormMouseMove(Sender:?TObject;?Shift:?TShiftState;?X,

Y:?Integer);

begin

if?FDrawEnable?then

begin

Ellipse(Canvas.Handle,?X?-?5,?Y?-?5,?X?+?5,?Y?+?5);

end;

end;

procedure?TForm2.FormMouseUp(Sender:?TObject;?Button:?TMouseButton;

Shift:?TShiftState;?X,?Y:?Integer);

begin

FDrawEnable?:=?False;

end;

procedure?TForm2.FormPaint(Sender:?TObject);

begin

Canvas.Draw(0,?0,?FBitMap);

end;

{?TScreenCanvas?}

procedure?TScreenCanvas.CreateHandle;

begin

inherited;

Handle?:=?GetDC(0);

end;

destructor?TScreenCanvas.Destroy;

begin

ReleaseDC(Handle,?0);

inherited;

end;

end.

你改下單元名和窗體的名字就可以用了.

TScreenCanvas是用來獲取桌面圖像的類.

只要掌握CopyRect函數就沒什么問題了,然后記錄幾個鼠標的點擊位置就可以把圖給截出來.圖片的拉伸移動也是CopyRect函數搞的

與50位技術專家面對面20年技術見證,附贈技術全景圖

總結

以上是生活随笔為你收集整理的java中qq中拉伸的文件,delphi中如何实现QQ中的截图并实现拉伸放大移动的功能的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。