我知道VC里有个getpix什么的函数,但不知在DELPHI中有没有相同的函数,是什么名字。
不是说是某个控件,而是说显示器的屏幕上的某个点。
不是说是某个控件,而是说显示器的屏幕上的某个点。
解决方案 »
- 如图所示,fastreport提示错误
- 请问怎么禁止Tedit控件中的复制,粘贴功能啊,在线等
- 这个软件要多少钱合适啊?欢迎指导!
- 建立了一个form,加入了project里,为什么一运行这个project就显示这个form?
- 如何把DELPHI的QREPORT组件的QRLABEL的CAPTION属性的横写文字改为竖写!!!
- 关于PChar数据类型
- DBGrid中如何才能响应某一个单元格双击事件?求教!急~~~~~
- 大家帮忙:为什么我在调试程序时不能跟踪进入VCL的方法代码?
- 還有問題要大家幫忙回答哦!!
- 如何制作 动画的托盘图标(非高手勿入)
- 关于数组的一个奇怪的问题:
- 如何同时批量更新主从表数据
TForm(frm).Position:=poDesktopCenter
else if (screen.width<=800) then
TForm(frm).WindowState :=wsMaximized;
在用一变量dc:=getdc(hnd)将得到桌面的HDC
在用GetPixel(dc) 得到颜色值就可以了
Dc: HDC;
MyCanvas: TCanvas;
MyRect: TRect;
Bmp: TBitmap
begin
Dc := GetWindowDC(0);
MyCanvas := TCanvas.Create;
try
MyCanvas.Handle := Dc;
MyRect:=Rect(0,0,Screen.Width, Screen.Height);
Bmp.PixelFormat := pf24bit;
Bmp.Width := MyRect.Right;
Bmp.Height := MyRect.Bottom;
Bmp.Canvas.CopyRect(MyRect, MyCanvas, MyRect);
Bmp.Canvas.Pixels[X,Y] ;
记不清了
var
DC:HDC;
X,Y:Integer;
begin
X:=Mouse.CursorPos.X;
Y:=Mouse.CursorPos.Y;
if Key<>VK_Return then Exit;
DC:=GetDC(0);
Color:=GetPixel(DC,X,Y);
end;
var
dc:hdc;
hnd:hwnd;
p:Tpoint;
begin
hnd:=getdesktopwindow(); //
dc:=getwindowdc(hnd); //
//上面的2句也可以写成dc:=getwindowdc(0)
windows.GetCursorPos(p);
label1.caption:=inttostr(getpixel(dc,p.X,p.Y));
releasedc(handle,dc);
end;
我写了一个给你,你要在窗体上放个timer,设置interval小点,为50
但是,
不能直接调用getpixel()这个API函数吗?
HDC是什么?
HDC hdc, // handle of device context
int XPos, // x-coordinate of pixel
int nYPos // y-coordinate of pixel
);
这个函数就是直接调用GDI里面API的。