hDC = g.GetHdc()
' create a solid brush
' NOTE: When using GDI, pass "A,B,G,R" to Color.FromARGB()
hBrush = CreateSolidBrush(Color.FromArgb(0, 0, 0, 255).ToArgb())
' select into the DC
Dim last As IntPtr = SelectObject(hDC, hBrush)
' fill it
ExtFloodFill(hDC, x, y, gdi_clr.ToArgb(), FLOODFILLSURFACE)
' restore last object
SelectObject(hDC, last)
' delete the brush
DeleteObject(hBrush)
'Catch e As Exception
'Throw (e)
Finally
' release the DC and dispose of the object
g.ReleaseHdc(hDC)
g.Dispose()
End Try
End Sub
I have copied all code down in a project but these bits are not 'liked'! Wiggly lines!
Dim bmp = CType(copyRect(src, _
New RectangleF(0, 0, 50, src.Height)), Bitmap)
dest.Image = bmp.CloneShorthand:
-or-
dest.Image = CType(copyRect(src, _ New RectangleF(0, 0, 50, src.Height)), Bitmap).Clone
It is in these bits of code where I, in my limited knowledge, get lost in not having come across those things before. I get 'scr' and 'dest' 'thrown out'. It may be a normal routine for those who have done it before so how do I get the image. I hope this hasn't sounded rude but I can't learn if I am not shown the way. Thank you. David.
I'm trying to create an exe to perform a screen capture for users with layered windows (this will be in a Yahoo! Widget that has screen capture functionality, with users that most-likely have Widgets on their desktop that they want captured.) I currently have a "working" C# executable, but it does a complete screen capture of the regularly layered windows, no Widgets. From my searching on the net, using BitBlt with the CaptureBlt constant included seems like the next avenue for experimentation, and this article seems to be the closest to what I need.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-31928-3.html
我宝明明最高SM炸了