GithubHelp home page GithubHelp logo

Comments (31)

 avatar commented on June 3, 2024

Needs research.

from budoco.

ctrager avatar ctrager commented on June 3, 2024

Have you worked with electron before? I just started this week.

from budoco.

 avatar commented on June 3, 2024

I'll start in a few minutes... 😄

from budoco.

ctrager avatar ctrager commented on June 3, 2024

@ivangrek - I have one more issue that I want to do , autoreplies to emails, and then I'm going to stop working on Budoco unless there are some actual people who are using it. If you want to keep working on it, then you should fork it, and then enjoy doing things YOUR way, with EF, etc.

The other open issues, they can all wait, or maybe I'll do them when I have trouble sleeping, but if somebody wants to use Budoco, those open issues aren't going to stop them. I wonder if anybody ever will use Budoco???

I'm going to focus on the screenshot tool also because I want to learn electron, and also because my son is starting a business that might involve electron.

If you want to keep in touch, I'm at [email protected].

from budoco.

 avatar commented on June 3, 2024

Ok. Will help.

main.js

const { app, BrowserWindow } = require('electron')

function createWindow () {
  const win = new BrowserWindow({
    frame: false,
    fullScreen: true,
    transparent: true,
    webPreferences: {
      nodeIntegration: true
    }
  })

  win.loadFile('index.html')
  win.setFullScreen(true);
}

app.whenReady().then(createWindow)

app.on('window-all-closed', () => {
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => {
  if (BrowserWindow.getAllWindows().length === 0) {
    createWindow()
  }
})

index.html

<!DOCTYPE html>
<html>
    <head style="min-width: 100vw; min-height: vh;">
        <meta charset="utf-8">
        <title>Electron App</title>
    </head>
    <body style="min-width: 100vw; min-height: vh;">
        <div id="h-rule" style="height: 0; border-top: 1px dashed red; position: fixed; top: 0; left: 0; right: 0;"></div>
        <div id="v-rule" style="width: 0; border-left: 1px dashed red; position: fixed; top: 0; bottom: 0; left: 0;"></div>
        <div id="region" style="display: none; width: 0; border: 1px dashed red; position: fixed; top: 0; bottom: 0; left: 0; right: 0;"></div>

        <script>
            const hRule = document.getElementById("h-rule");
            const vRule = document.getElementById("v-rule");
            const region = document.getElementById("region");
            var selection = false;
            var startPoint;
            var endPoint;

            document.addEventListener("mousemove", (e) => {
                hRule.style.top = `${e.pageY}px`;
                vRule.style.left = `${e.pageX}px`;

                if(selection) {
                    endPoint = {
                        pageX: e.pageX,
                        pageY: e.pageY
                    };

                    if(endPoint.pageX - startPoint.pageX < 0) {
                        [startPoint.pageX, endPoint.pageX] = [endPoint.pageX, startPoint.pageX];
                    }

                    if(endPoint.pageY - startPoint.pageY < 0) {
                        [startPoint.pageY, endPoint.pageY] = [endPoint.pageY, startPoint.pageY];
                    }

                    region.style.top = `${startPoint.pageY}px`;
                    region.style.left = `${startPoint.pageX}px`;

                    region.style.width = `${endPoint.pageX - startPoint.pageX}px`;
                    region.style.height = `${endPoint.pageY - startPoint.pageY}px`;
                }
            });

            document.addEventListener("mousedown", (e) => {
                e.preventDefault();

                selection = true;

                startPoint = {
                    pageX: e.pageX,
                    pageY: e.pageY
                };

                region.style.display = "block";
            });

            document.addEventListener("mouseup", (e) => {
                e.preventDefault();

                selection = false;

                region.style.display = "none";
            });
        </script>
    </body>
</html>

image

Good luck!

from budoco.

ctrager avatar ctrager commented on June 3, 2024

Your such a fast learner!!

from budoco.

ctrager avatar ctrager commented on June 3, 2024

IMG_20201211_210124

Isn't transparent on my machine Mint 20, based on Ubuntu 20. The behavior of Electron windows is definitely different on different platforms.

from budoco.

ctrager avatar ctrager commented on June 3, 2024

https://stackoverflow.com/questions/54763647/transparent-windows-on-linux-electron

from budoco.

ctrager avatar ctrager commented on June 3, 2024

Add this worked:
app.commandLine.appendSwitch('enable-transparent-visuals');
app.commandLine.appendSwitch('disable-gpu');

from budoco.

 avatar commented on June 3, 2024

You can also run the index.html file in browser.

from budoco.

ctrager avatar ctrager commented on June 3, 2024

@ivangrek
It's ugly, but the technology works end to end:
https://github.com/ctrager/budoco_screenshot
Thanks for your help with the transparent window. I still have a lot of work to do, but I don't have any research to do.

from budoco.

 avatar commented on June 3, 2024

I can't select a region on the Windows now.

from budoco.

ctrager avatar ctrager commented on June 3, 2024

Works for me, but I see discussions about different behavior on different OSs.
https://drive.google.com/file/d/1OI8GXfTyTgrzwz2U4rNuKHH04UZSsn3G/view?usp=sharing

from budoco.

 avatar commented on June 3, 2024

Works super!

from budoco.

ctrager avatar ctrager commented on June 3, 2024

@ivangrek - I'm confused. Did you have to make code changes to make it work for you?

from budoco.

ctrager avatar ctrager commented on June 3, 2024

and, just curious, where do you live?

from budoco.

 avatar commented on June 3, 2024

@ivangrek - I'm confused. Did you have to make code changes to make it work for you?

I am doing some changes and testing how it works.

from budoco.

ctrager avatar ctrager commented on June 3, 2024

You didn't anwer my question - Did you have ot make code changes to make it work for you?

from budoco.

 avatar commented on June 3, 2024

Did you have ot make code changes to make it work for you?

I don't think I understand the question. I made such changes and it worked for me.

transparent.html

<head style="min-width: 100vw; min-height: vh;"> to <html>
<body style="min-width: 100vw; min-height: vh;"> to <body style="background-color: rgba(0, 0, 0, 0.01);">

background-color: rgba(0, 0, 0, 0.01);

Displays the transparent layer. Without this, the layer does not appear at all.

from budoco.

ctrager avatar ctrager commented on June 3, 2024

What's your OS?

from budoco.

 avatar commented on June 3, 2024

What's your OS?

Windows 10.

from budoco.

 avatar commented on June 3, 2024

If you close the transparent window, then the main thing will not appear, and the process will not end.

from budoco.

 avatar commented on June 3, 2024

1

from budoco.

ctrager avatar ctrager commented on June 3, 2024

@ivangrek - Can you get the latest and tell me if it works okay on your Windows 10?

from budoco.

 avatar commented on June 3, 2024

Works!

Except electron/electron#21538.
I think can turn off window resizing to prevent this case.

transparent_win.loadFile('transparent.html')
transparent_win.setFullScreen(true);
transparent_win.setResizable(false);

image

from budoco.

ctrager avatar ctrager commented on June 3, 2024

I put in your change. I couldn't reproduce your bug, but still I put in your change. Also, now you can draw on the screenshot, for example to circle things, before you send it. I think it's done.

from budoco.

 avatar commented on June 3, 2024

The brush sometimes does not reset and starts drawing immediately without pressing, if you make several pictures in a row.

image

from budoco.

ctrager avatar ctrager commented on June 3, 2024

I created an issue for this in the budoco_screenshot repo. Do you want to work on it?

ctrager/budoco_screenshot#1

from budoco.

 avatar commented on June 3, 2024

Try select "Capture" and close transparent window. I do it with Alt + F4.
Main window not showing and process still running.

from budoco.

 avatar commented on June 3, 2024

I created an issue for this in the budoco_screenshot repo. Do you want to work on it?

Ok. I will fix it.

from budoco.

ctrager avatar ctrager commented on June 3, 2024

If the user has to hit Alt + F4 to CAUSE this bug, I don't want to fix it.

from budoco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.