How can I cut out an area of the screen and save it as a picture in the clipboard ?
How can I cut out an area of the screen and save it as a picture in the clipboard ?
Very nice, but I need to use bitblt()
why ?
I made a TcropImage class and I use bitblt()
Do you mean taking the screen shot of an screen area within a FWH application itself, or just within a windows desktop in general? If the latter from Windows 7 on Windows has included a utility named Snipping Tool that works reasonably well. It has existed in Windows 10 for a while but it looks like Microsoft is moving the functionality to a tool they have named Snip & Sketch (which I just learned now when I started the Snipping Tool).
Yes, I mean a screenshot of a part of the screen. I get his device context GetDc() and convert to bitmap (don't remember how to do it)
can you use HB_CROPPED I use in that class
can you use HB_CROPPED I use in that class
Function CutImage(nBoxTop,nBoxLeft,nBoxBottom,nBoxRight)
local nType:= 2 //jpg
Local cNameFileCropped:="cropped.jpg"
Local nWBmp,nHBmp
oImageCropped:hBitmap:= CropImage( oImage:hBitmap,nBoxTop,nBoxLeft, nBoxBottom, nBoxRight)
oImageCropped:SaveImage( cNameFileCropped, nType)
oImageCropped:LoadBmp( cNameFileCropped )
nWBmp := alltrim(str(nBmpWidth( oImageCropped:hBitmap )))
nHBmp := alltrim(str(nBmpHeight( oImageCropped:hBitmap ) ))
oGroupCropped:setText("Image Cropped : Dim. "+nWBmp+"X"+nHBmp )
oGroupCropped:refresh()
return nilNatter wrote:How can I cut out an area of the screen and save it as a picture in the clipboard ?
hBmp := FWSaveScreen( GetDesktopWindow(), nTop, nLeft, nBottom, nRight )
DEFINE CLIPBOARD oClp FORMAT BITMAP OF oWnd
oClp:Open()
oClp:SetBitmap( hBmp )
oClp:Close()Thank you, Mr. Rao.
Is it possible to insert the cut fragment at the specified position of the screen ?
Natter wrote:Thank you, Mr. Rao.
Is it possible to insert the cut fragment at the specified position of the screen ?
I drew something on the window - a line, a polygon, etc.. Then I want to erase the painting.
Natter wrote:I drew something on the window - a line, a polygon, etc.. Then I want to erase the painting.