You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide example code:
func TakeScreenshot(vendorID string, integrationType string, subVendor string) (filename string, err error) {
screenWidth, screenHeight := robotgo.GetScreenSize()
// Capture a screenshot of the entire screen
ct := time.Now()
screenshot := robotgo.CaptureScreen(0, 0, screenWidth, screenHeight)
fileName := fmt.Sprintf("%s_%s_%s_%s.png", subVendor, integrationType, vendorID, ct.Format("15_04_05"))
// Save the screenshot as a PNG file
robotgo.SaveBitmap(screenshot, "tmp/"+fileName)
// defer os.Remove(fileName) // Remove the local screenshot file when done
// Upload to S3 bucket using PutObject API call
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
my screen shot function work fine but When I tried to open my screen shot it shows like purple and green background.
Robotgo version (or commit ref): github.com/go-vgo/robotgo v0.100.10
Go version: golang:1.19.3
Gcc version: Installed: 4:11.2.0-1ubuntu1
Candidate: 4:11.2.0-1ubuntu1
Operating system and bit: Ubuntu 22.04.2 LTS 64-bit
Can you reproduce the bug at Examples:
Provide example code:
func TakeScreenshot(vendorID string, integrationType string, subVendor string) (filename string, err error) {
screenWidth, screenHeight := robotgo.GetScreenSize()
// Capture a screenshot of the entire screen
ct := time.Now()
screenshot := robotgo.CaptureScreen(0, 0, screenWidth, screenHeight)
fileName := fmt.Sprintf("%s_%s_%s_%s.png", subVendor, integrationType, vendorID, ct.Format("15_04_05"))
// Save the screenshot as a PNG file
robotgo.SaveBitmap(screenshot, "tmp/"+fileName)
// defer os.Remove(fileName) // Remove the local screenshot file when done
file, err := os.Open("tmp/" + fileName)
if err != nil {
return fileName, err
}
defer file.Close()
// Upload to S3 bucket using PutObject API call
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
}))
svc := s3.New(sess)
bucketName := os.Getenv("s3Bucket")
_, err = svc.PutObject(&s3.PutObjectInput{
Bucket: aws.String(bucketName),
Key: aws.String("errors/" + fileName),
Body: file,
})
if err != nil {
return fileName, err
}
return fileName, nil
}
Description
I am getting the screenshot with green, purple background.
The text was updated successfully, but these errors were encountered: