Cookie Consent by Free Privacy Policy Generator Aktuallisiere deine Cookie Einstellungen ๐Ÿ“Œ region-screenshot-js helps you quickly build the selection screenshot function


๐Ÿ“š region-screenshot-js helps you quickly build the selection screenshot function


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

live demo:https://github.com/weijun-lab/region-screenshot-js
github:https://weijun-lab.github.io/region-screenshot-js

This article describes how to use the plug-in region-screenshot-js to succinctly and efficiently achieve the selection screenshot function on the web side, and draw specific patterns and mosaics on the screenshot. If the plug-in comes with pattern drawing can not meet your needs, you can customize drawing through the customDrawing configuration item of the plug-in. The following is only a basic indication, more functions and usage refer to the documentation. This is a plug-in I developed in my spare time, nearly two thousand lines of code, writing a little two months. If you have any suggestions or comments about this plugin, you can put them in the Issues. If it helps you, please click on star.

Image description

Code example๏ผš

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,
        html {
            height: 100%;
            width: 100%;
        }

        * {
            margin: 0;
            padding: 0;
        }

        body {
            background-image: url(./assets/bg.png);
            background-size: cover;
            background-position: center;
        }
    </style>
</head>

<body>

</body>
<script src="./dist/region-screenshot.umd.js"></script>
<script>
let screenshot = new RegionScreenshot({
    regionColor:"#00ff28"
});
let screenshot = new RegionScreenshot();
screenshot.on("successCreated",(dataUrl)=>{
    console.log("Plugin initialized successfully.");
});
screenshot.on("screenshotGenerated",(dataUrl)=>{
    console.log(dataUrl);
});
</script>

</html>

If the current drawing tool does not meet your needs, you can customize a drawing tool through the customDrawing configuration item

Image description
Code example๏ผš

Image description

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body,
        html {
            height: 100%;
            width: 100%;
        }

        * {
            margin: 0;
            padding: 0;
        }

        body {
            background-image: url(./assets/bg.png);
            background-size: cover;
            background-position: center;
        }
        .region-screenshot_custom_tools.emoji .region-screenshot_tools_btn {
            background-image: url(./assets/emoji.png);
        }

        .region-screenshot_custom_tools.emoji.region-screenshot_active .region-screenshot_tools_btn {
            background-image: url(./assets/emoji_active.png);
        }

        .region-screenshot_custom_tools.emoji .region-screenshot_tools_options img {
            width: 20px;
            margin-right: 10px;
            cursor: pointer;
        }

        .region-screenshot_custom_tools.emoji .region-screenshot_tools_options img.active {
            filter: brightness(1.2)
        }
    </style>
</head>

<body>

</body>
<script src="./dist/region-screenshot.umd.js"></script>
<script src="https://unpkg.com/[email protected]/dist/jquery.js"></script>
<script>
    let screenshot = new RegionScreenshot({
        customDrawing: [
            {
                className: "emoji",
                optionsHtml: `
                        <img class="active" src="assets/emoji-1.png"/>
                        <img src="assets/emoji-2.png"/>
                        <img src="assets/emoji-3.png"/>
                        <img src="assets/emoji-4.png"/>
                    `,
                onOptionsCreated(optionsEl) {
                    $(optionsEl)
                        .find("img")
                        .click(function () {
                            $(this).addClass("active");
                            $(this).siblings().removeClass("active");
                        });
                },

                onDrawingOpen(canvasEl, optionsEl, saveCallback) {
                    let ctx = canvasEl.getContext("2d");
                    canvasEl.style.cursor = "crosshair";
                    canvasEl.onclick = function (e) {
                        let img = $(optionsEl).find(".active")[0];
                        ctx.drawImage(
                            img,
                            e.offsetX - img.naturalWidth / 2,
                            e.offsetY - img.naturalWidth / 2
                        );
                        saveCallback();
                    };
                },
                onDrawingClose(canvasEl,optionsEl) {
                    canvasEl.onclick = null;
                    canvasEl.style.cursor = "default";
                },
            },
        ],
    });


</script>

</html>


emoji.png emoji.png

emoji_active.png emoji_active.png

emoji-1.png emoji-1.png

emoji-2.png emoji-2.png

emoji-3.png emoji-3.png

emoji-4.png emoji-4.png

...



๐Ÿ“Œ GTK Selection Editing and Window Selection


๐Ÿ“ˆ 30.49 Punkte

๐Ÿ“Œ CVE-2022-23308 | Oracle Communications Cloud Native Core Network Slice Selection Function NSSF denial of service


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2020-36518 | Oracle Communications Cloud Native Core Network Slice Selection Function NSSF denial of service


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2021-37750 | Oracle Communications Cloud Native Core Network Slice Selection Function NSSF denial of service


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2022-40304 | Oracle Communications Cloud Native Core Network Slice Selection Function Oracle Linux xml external entity reference


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2022-42003 | Oracle Communications Cloud Native Core Network Slice Selection Function Platform denial of service


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2022-3171 | Oracle Communications Cloud Native Core Network Slice Selection Function Platform denial of service


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ The Critical Role of Loss Function Selection in Creating Accurate Time Series Forecasts


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2023-34034 | Oracle Communications Cloud Native Core Network Slice Selection Function Install/Upgrade Remote Code Execution


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2023-31486 | Oracle Communications Cloud Native Core Network Slice Selection Function Install/Upgrade certificate validation


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2023-44487 | Oracle Communications Cloud Native Core Network Slice Selection Function Install/Upgrade denial of service


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2023-44487 | Oracle Communications Cloud Native Core Network Slice Selection Function Install/Upgrade denial of service


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2022-22965 | Oracle Communications Cloud Native Core Network Slice Selection Function NSSF code injection


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ CVE-2022-22947 | Oracle Communications Cloud Native Core Network Slice Selection Function NSSF code injection


๐Ÿ“ˆ 25.08 Punkte

๐Ÿ“Œ libgig 4.0.0 gig File gig.cpp gig::Region::Region denial of service


๐Ÿ“ˆ 24.99 Punkte

๐Ÿ“Œ AWS Intra-Region VPC Peering: Conectando VPCs en la Misma Regiรณn con Terraform


๐Ÿ“ˆ 24.99 Punkte

๐Ÿ“Œ libgig 4.0.0 gig File gig.cpp gig::Region::Region Denial of Service


๐Ÿ“ˆ 24.99 Punkte

๐Ÿ“Œ Cloudflareโ€™s DLS in the Asia Pacific region helps customers comply with their data localization obligations


๐Ÿ“ˆ 22.98 Punkte

๐Ÿ“Œ Siren 11.0 helps investigative teams quickly conduct SIGINT, CYBINT, and OSINT investigations


๐Ÿ“ˆ 22.87 Punkte

๐Ÿ“Œ Threat Stack helps security teams quickly detect and remediate threats in cloud infrastructure


๐Ÿ“ˆ 22.87 Punkte

๐Ÿ“Œ Seagate Lyve Data Transfer Services helps businesses quickly move mass data from edge to cloud


๐Ÿ“ˆ 22.87 Punkte

๐Ÿ“Œ Docker Build Cloud Helps Developers Speed Up Build Time


๐Ÿ“ˆ 20.41 Punkte

๐Ÿ“Œ Docker Build Cloud Helps Speed Up Build Time


๐Ÿ“ˆ 20.41 Punkte

๐Ÿ“Œ Modifing XKB to disable function keys, Have yet to be successful in disabling any of the function keys at all.


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ Arrow Function vs Function


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ How to Create and Test an HTTP-Triggered Function with Azure Function App


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ Function Declaration vs Function Expression


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ Building an Address Search Function with Amazon Location SDK and API key function


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ [Question] It is possible to jump to a function with BL, store value stored in x1 and return it in the first function ?


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ JavaScript Function , First Class function / First Class Citizen in JavaScript


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ When to Use a Function Expression vs. Function Declaration


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ Function declaration and Function Expression


๐Ÿ“ˆ 19.67 Punkte

๐Ÿ“Œ Understanding JavaScript Function Declarations: 'function' vs 'const'


๐Ÿ“ˆ 19.67 Punkte











matomo