How to create resize box on desktop?
Posted: Sat Sep 29, 2012 5:08 am
Hi experts....
Hope you can kindly assist me...
I am using the following codes for screen capture obtained from forum here ... it works fine.
However , like all sreen captures we need an option to allow to select the size and part of the screen to be captured.
This can be accomplished by changing the widht and height of the capture.
However , I need to allow the users to resize on the screen with a GUI , so that they can actually pin point the actual part of the screen to be captured.
Is there a ready script for this anywhere or maybe can provide me a hint on the syntax to use...or which purebasic syntax can enable this ?
Many thanks to you all...
Regards
Alan
[quote;capture a piece of screen
Procedure.l CaptureScreen(Left.l, Top.l, Width.l, Height.l)
dm.DEVMODE
BMPHandle.l
srcDC = CreateDC_("DISPLAY", "", "", dm)
trgDC = CreateCompatibleDC_(srcDC)
BMPHandle = CreateCompatibleBitmap_(srcDC, Width, Height)
SelectObject_( trgDC, BMPHandle)
BitBlt_( trgDC, 0, 0, Width, Height, srcDC, Left, Top, #SRCCOPY)
DeleteDC_( trgDC)
ReleaseDC_( BMPHandle, srcDC)
ProcedureReturn BMPHandle
EndProcedure
;ScreenCaptureAddress = CaptureScreen(192, 112, 256, 256)
ScreenCaptureAddress = CaptureScreen(00,0, 1000, 1000)
UseJPEGImageEncoder()
CreateImage(0, 1000, 1000)
;StartDrawing(ImageOutput())
StartDrawing(ImageOutput(0))
DrawImage(ScreenCaptureAddress, 0, 0)
StopDrawing()
SaveImage(0, "c:\Screenshotjpg2.JPG",#PB_ImagePlugin_JPEG)
RunProgram("c:\screenshotjpg2.jpg")
][/quote]
Hope you can kindly assist me...
I am using the following codes for screen capture obtained from forum here ... it works fine.
However , like all sreen captures we need an option to allow to select the size and part of the screen to be captured.
This can be accomplished by changing the widht and height of the capture.
However , I need to allow the users to resize on the screen with a GUI , so that they can actually pin point the actual part of the screen to be captured.
Is there a ready script for this anywhere or maybe can provide me a hint on the syntax to use...or which purebasic syntax can enable this ?
Many thanks to you all...
Regards
Alan
[quote;capture a piece of screen
Procedure.l CaptureScreen(Left.l, Top.l, Width.l, Height.l)
dm.DEVMODE
BMPHandle.l
srcDC = CreateDC_("DISPLAY", "", "", dm)
trgDC = CreateCompatibleDC_(srcDC)
BMPHandle = CreateCompatibleBitmap_(srcDC, Width, Height)
SelectObject_( trgDC, BMPHandle)
BitBlt_( trgDC, 0, 0, Width, Height, srcDC, Left, Top, #SRCCOPY)
DeleteDC_( trgDC)
ReleaseDC_( BMPHandle, srcDC)
ProcedureReturn BMPHandle
EndProcedure
;ScreenCaptureAddress = CaptureScreen(192, 112, 256, 256)
ScreenCaptureAddress = CaptureScreen(00,0, 1000, 1000)
UseJPEGImageEncoder()
CreateImage(0, 1000, 1000)
;StartDrawing(ImageOutput())
StartDrawing(ImageOutput(0))
DrawImage(ScreenCaptureAddress, 0, 0)
StopDrawing()
SaveImage(0, "c:\Screenshotjpg2.JPG",#PB_ImagePlugin_JPEG)
RunProgram("c:\screenshotjpg2.jpg")
][/quote]