上传的图像在canvas中拖动,在html5中可触摸和旋转

2023-12-31

我是 Html5 的新手。我正在上传图像,但它没有显示在画布中,如果我提供图像的直接来源,那么它将起作用。我从此链接获取帮助javascript:上传图像文件并将其绘制到画布中 https://stackoverflow.com/questions/22255580/javascript-upload-image-file-and-draw-it-into-a-canvas我会告诉你我的代码。

<style>
            body {
                padding:0px;
            }
            #canvas {
                border:1px solid red;
            }
        </style>

        <div id="bg">
            <canvas id="canvas" style="margin-top:32px;margin-left:65px;" width=700 height=350></canvas>
        </div>
        <br>Click and drag the image or drag the dots to resize.
        <br>
        <!--        <br>Text:
                <input type="textarea" id="words" value="" />-->
        <input type="file" id="input" name="imageLoader" />

        <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>


        <script>
            var canvas = document.getElementById('canvas');
            var ctx = canvas.getContext('2d');

//            var Input = document.getElementById('words');
            var x = 10;
            var y = 30;
            ctx.font = "bold 20px sans-serif";
            ctx.fillStyle = "black";
//            $('#words').keyup(function () {
//                ctx.fillText($("#words").val(), x, y);
//            });



            var canvasOffset = $("#canvas").offset();
            var offsetX = canvasOffset.left;
            var offsetY = canvasOffset.top;

            var startX;
            var startY;
            var isDown = false;

            var pi2 = Math.PI * 2;
            var resizerRadius = 3;
            var rr = resizerRadius * resizerRadius;
            var draggingResizer = {
                x: 0,
                y: 0
            };
            var imageX = 39;
            var imageY = 15;
            var imageWidth, imageHeight, imageRight, imageBottom;
            var draggingImage = false;
            var startX;
            var startY;

            var img = new Image();
            img.onload = function () {
                imageWidth = 165;
                imageHeight = 125;
                imageRight = imageX + imageWidth;
                imageBottom = imageY + imageHeight
                draw(true, false);
            }
            var b;

            var input = document.getElementById('input');
            input.addEventListener('change', handleFiles);

            function handleFiles(e) {
                var ctx = document.getElementById('canvas').getContext('2d');
                var img = new Image;
                b = URL.createObjectURL(e.target.files[0]);
                console.log("jkfdhgjkdfhgjkdf   " + b);
                img.onload = function () {
                    ctx.drawImage(img, 60, 60);
                }
            }

            img.src = "https://d3s16h6oq3j5fb.cloudfront.net/1.11.0/img/new-city-home/bang-img/cake3.jpg";

            function draw(withAnchors, withBorders) {

                // clear the canvas
                ctx.clearRect(0, 0, canvas.width, canvas.height);

                // draw the image
                ctx.drawImage(img, 0, 0, img.width, img.height, imageX, imageY, imageWidth, imageHeight);

                // optionally draw the draggable anchors
                if (withAnchors) {
                    drawDragAnchor(imageX, imageY);
                    drawDragAnchor(imageRight, imageY);
                    drawDragAnchor(imageRight, imageBottom);
                    drawDragAnchor(imageX, imageBottom);
                }

                // optionally draw the connecting anchor lines
                if (withBorders) {
                    ctx.beginPath();
                    ctx.moveTo(imageX, imageY);
                    ctx.lineTo(imageRight, imageY);
                    ctx.lineTo(imageRight, imageBottom);
                    ctx.lineTo(imageX, imageBottom);
                    ctx.closePath();
                    ctx.stroke();
                }

            }

            function drawDragAnchor(x, y) {
                ctx.beginPath();
                ctx.arc(x, y, resizerRadius, 0, pi2, false);
                ctx.closePath();
                ctx.fill();
            }

            function anchorHitTest(x, y) {

                var dx, dy;

                // top-left
                dx = x - imageX;
                dy = y - imageY;
                if (dx * dx + dy * dy <= rr) {
                    return (0);
                }
                // top-right
                dx = x - imageRight;
                dy = y - imageY;
                if (dx * dx + dy * dy <= rr) {
                    return (1);
                }
                // bottom-right
                dx = x - imageRight;
                dy = y - imageBottom;
                if (dx * dx + dy * dy <= rr) {
                    return (2);
                }
                // bottom-left
                dx = x - imageX;
                dy = y - imageBottom;
                if (dx * dx + dy * dy <= rr) {
                    return (3);
                }
                return (-1);

            }


            function hitImage(x, y) {
                return (x > imageX && x < imageX + imageWidth && y > imageY && y < imageY + imageHeight);
            }


            function handleMouseDown(e) {
                startX = parseInt(e.clientX - offsetX);
                startY = parseInt(e.clientY - offsetY);
                draggingResizer = anchorHitTest(startX, startY);
                draggingImage = draggingResizer < 0 && hitImage(startX, startY);
            }

            function handleMouseUp(e) {
                draggingResizer = -1;
                draggingImage = false;
                draw(true, false);
            }

            function handleMouseOut(e) {
                handleMouseUp(e);
            }

            function handleMouseMove(e) {
                if (draggingResizer > -1) {
                    mouseX = parseInt(e.clientX - offsetX);
                    mouseY = parseInt(e.clientY - offsetY);
                    // resize the image
                    switch (draggingResizer) {
                        case 0:
                            //top-left
                            imageX = mouseX;
                            imageWidth = imageRight - mouseX;
                            imageY = mouseY;
                            imageHeight = imageBottom - mouseY;
                            break;
                        case 1:
                            //top-right
                            imageY = mouseY;
                            imageWidth = mouseX - imageX;
                            imageHeight = imageBottom - mouseY;
                            break;
                        case 2:
                            //bottom-right
                            imageWidth = mouseX - imageX;
                            imageHeight = mouseY - imageY;
                            break;
                        case 3:
                            //bottom-left
                            imageX = mouseX;
                            imageWidth = imageRight - mouseX;
                            imageHeight = mouseY - imageY;
                            break;
                    }

                    if (imageWidth < 25) {
                        imageWidth = 25;
                    }
                    if (imageHeight < 25) {
                        imageHeight = 25;
                    }

                    // set the image right and bottom
                    imageRight = imageX + imageWidth;
                    imageBottom = imageY + imageHeight;

                    // redraw the image with resizing anchors
                    draw(true, true);

                } else if (draggingImage) {

                    imageClick = false;

                    mouseX = parseInt(e.clientX - offsetX);
                    mouseY = parseInt(e.clientY - offsetY);

                    // move the image by the amount of the latest drag
                    var dx = mouseX - startX;
                    var dy = mouseY - startY;
                    imageX += dx;
                    imageY += dy;
                    imageRight += dx;
                    imageBottom += dy;
                    // reset the startXY for next time
                    startX = mouseX;
                    startY = mouseY;

                    // redraw the image with border
                    draw(false, true);
                }
            }


            $("#canvas").mousedown(function (e) {
                handleMouseDown(e);
            });
            $("#canvas").mousemove(function (e) {
                handleMouseMove(e);
            });
            $("#canvas").mouseup(function (e) {
                handleMouseUp(e);
            });
            $("#canvas").mouseout(function (e) {
                handleMouseOut(e);
            });
        </script>

enter image description here
In this screen shot image is resizable with (img.src="https://d3s16h6oq3j5fb.cloudfront.net/1.11.0/img/new-city-home/bang-img/cake3.jpg"). But i want this image upload in canvas by user. When i am upload image by user then it will not working. I will give you one more screen shot.enter image description here enter image description here

我改变了现有代码中的一些想法。现在图像由用户上传。

<style>
            body {
                padding:0px;
            }
            #canvas {
                border:1px solid red;
            }
        </style>

        <div id="bg">
            <canvas id="canvas" style="margin-top:32px;margin-left:65px;" width=700 height=350></canvas>
        </div>
        <br>Click and drag the image or drag the dots to resize.
        <br>
        <!--        <br>Text:
                <input type="textarea" id="words" value="" />-->
        <input type="file" id="input" name="imageLoader" />

        <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>


        <script>
            var canvas = document.getElementById('canvas');
            var ctx = canvas.getContext('2d');

//            var Input = document.getElementById('words');
            var x = 10;
            var y = 30;
            ctx.font = "bold 20px sans-serif";
            ctx.fillStyle = "black";
//            $('#words').keyup(function () {
//                ctx.fillText($("#words").val(), x, y);
//            });



            var canvasOffset = $("#canvas").offset();
            var offsetX = canvasOffset.left;
            var offsetY = canvasOffset.top;

            var startX;
            var startY;
            var isDown = false;

            var pi2 = Math.PI * 2;
            var resizerRadius = 3;
            var rr = resizerRadius * resizerRadius;
            var draggingResizer = {
                x: 0,
                y: 0
            };
            var imageX = 39;
            var imageY = 15;
            var imageWidth, imageHeight, imageRight, imageBottom;
            var draggingImage = false;
            var startX;
            var startY;

            var img = new Image();
            img.onload = function () {
                imageWidth = 165;
                imageHeight = 125;
                imageRight = imageX + imageWidth;
                imageBottom = imageY + imageHeight
                draw(true, false);
            }
            var b;

            var input = document.getElementById('input');
            input.addEventListener('change', handleFiles);

            function handleFiles(e) {
                var ctx = document.getElementById('canvas').getContext('2d');
                var img = new Image;
                img.src = URL.createObjectURL(e.target.files[0]);
                console.log("jkfdhgjkdfhgjkdf   " + b);
                img.onload = function draw(withAnchors, withBorders) {

                    // clear the canvas
                    ctx.clearRect(0, 0, canvas.width, canvas.height);

                    // draw the image
                    ctx.drawImage(img, 0, 0, img.width, img.height, imageX, imageY, imageWidth, imageHeight);

                    // optionally draw the draggable anchors
                    if (withAnchors) {
                        drawDragAnchor(imageX, imageY);
                        drawDragAnchor(imageRight, imageY);
                        drawDragAnchor(imageRight, imageBottom);
                        drawDragAnchor(imageX, imageBottom);
                    }

                    // optionally draw the connecting anchor lines
                    if (withBorders) {
                        ctx.beginPath();
                        ctx.moveTo(imageX, imageY);
                        ctx.lineTo(imageRight, imageY);
                        ctx.lineTo(imageRight, imageBottom);
                        ctx.lineTo(imageX, imageBottom);
                        ctx.closePath();
                        ctx.stroke();
                    }

                }

                function drawDragAnchor(x, y) {
                    ctx.beginPath();
                    ctx.arc(x, y, resizerRadius, 0, pi2, false);
                    ctx.closePath();
                    ctx.fill();
                }

                function anchorHitTest(x, y) {

                    var dx, dy;

                    // top-left
                    dx = x - imageX;
                    dy = y - imageY;
                    if (dx * dx + dy * dy <= rr) {
                        return (0);
                    }
                    // top-right
                    dx = x - imageRight;
                    dy = y - imageY;
                    if (dx * dx + dy * dy <= rr) {
                        return (1);
                    }
                    // bottom-right
                    dx = x - imageRight;
                    dy = y - imageBottom;
                    if (dx * dx + dy * dy <= rr) {
                        return (2);
                    }
                    // bottom-left
                    dx = x - imageX;
                    dy = y - imageBottom;
                    if (dx * dx + dy * dy <= rr) {
                        return (3);
                    }
                    return (-1);

                }


                function hitImage(x, y) {
                    return (x > imageX && x < imageX + imageWidth && y > imageY && y < imageY + imageHeight);
                }


                function handleMouseDown(e) {
                    startX = parseInt(e.clientX - offsetX);
                    startY = parseInt(e.clientY - offsetY);
                    draggingResizer = anchorHitTest(startX, startY);
                    draggingImage = draggingResizer < 0 && hitImage(startX, startY);
                }

                function handleMouseUp(e) {
                    draggingResizer = -1;
                    draggingImage = false;
                    draw(true, false);
                }

                function handleMouseOut(e) {
                    handleMouseUp(e);
                }

                function handleMouseMove(e) {
                    if (draggingResizer > -1) {
                        mouseX = parseInt(e.clientX - offsetX);
                        mouseY = parseInt(e.clientY - offsetY);
                        // resize the image
                        switch (draggingResizer) {
                            case 0:
                                //top-left
                                imageX = mouseX;
                                imageWidth = imageRight - mouseX;
                                imageY = mouseY;
                                imageHeight = imageBottom - mouseY;
                                break;
                            case 1:
                                //top-right
                                imageY = mouseY;
                                imageWidth = mouseX - imageX;
                                imageHeight = imageBottom - mouseY;
                                break;
                            case 2:
                                //bottom-right
                                imageWidth = mouseX - imageX;
                                imageHeight = mouseY - imageY;
                                break;
                            case 3:
                                //bottom-left
                                imageX = mouseX;
                                imageWidth = imageRight - mouseX;
                                imageHeight = mouseY - imageY;
                                break;
                        }

                        if (imageWidth < 25) {
                            imageWidth = 25;
                        }
                        if (imageHeight < 25) {
                            imageHeight = 25;
                        }

                        // set the image right and bottom
                        imageRight = imageX + imageWidth;
                        imageBottom = imageY + imageHeight;

                        // redraw the image with resizing anchors
                        draw(true, true);

                    } else if (draggingImage) {

                        imageClick = false;

                        mouseX = parseInt(e.clientX - offsetX);
                        mouseY = parseInt(e.clientY - offsetY);

                        // move the image by the amount of the latest drag
                        var dx = mouseX - startX;
                        var dy = mouseY - startY;
                        imageX += dx;
                        imageY += dy;
                        imageRight += dx;
                        imageBottom += dy;
                        // reset the startXY for next time
                        startX = mouseX;
                        startY = mouseY;

                        // redraw the image with border
                        draw(false, true);
                    }

                }
            }

            $("#canvas").mousedown(function (e) {
                handleMouseDown(e);
            });
            $("#canvas").mousemove(function (e) {
                handleMouseMove(e);
            });
            $("#canvas").mouseup(function (e) {
                handleMouseUp(e);
            });
            $("#canvas").mouseout(function (e) {
                handleMouseOut(e);
            });



            img.src = "https://d3s16h6oq3j5fb.cloudfront.net/1.11.0/img/new-city-home/bang-img/cake3.jpg";


        </script>

Till now image not rotate and draggable. enter image description here

请告诉我如何在画布中拖动和移动该图像。
请分享您的想法。因为这对我来说非常重要。提前致谢。


var canvas = new fabric.Canvas('canvas');
document.getElementById('file').addEventListener("change", function (e) {
  var file = e.target.files[0];
  var reader = new FileReader();
  reader.onload = function (f) {
    var data = f.target.result;                    
    fabric.Image.fromURL(data, function (img) {
      var oImg = img.set({left: 0, top: 0, angle: 00,width:100, height:100}).scale(0.9);
      canvas.add(oImg).renderAll();
      var a = canvas.setActiveObject(oImg);
      var dataURL = canvas.toDataURL({format: 'png', quality: 0.8});
    });
  };
  reader.readAsDataURL(file);
});
canvas{
  border: 1px solid black;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://rawgit.com/kangax/fabric.js/master/dist/fabric.min.js"></script>
<input type="file" id="file"><br />
<canvas id="canvas" width="450" height="450"></canvas>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

上传的图像在canvas中拖动,在html5中可触摸和旋转 的相关文章

  • 使用 python 在一个 html 页面中显示分割数据框的 HTML 代码

    我是 html css 新手 所以对以 html 格式显示的数据有疑问 我有一个很长的列表 我想将其拆分并以 html 格式显示为两个单独的列 例如 而不是 Col1 Col2 1 a 2 a 3 a 4 a 5 b 6 b 7 b 8 b
  • 在 HTML5 Javascript 中将 BlobBuilder 转换为字符串

    function blobToString blob var reader new FileReader var d reader onloadend function d callback reader result console lo
  • 将 XSL-FO 转换为 HTML

    我有一组用于 PDF 生成的 XSL FO 文档 我还需要将相同的输出数据 PDF 格式 导出为 HTML 文件 此外 我需要 HTML 具有与 PDF 类似的样式 有没有办法使用 C 将 XSL FO 转换为 XHTML NOTE 我知道
  • 点击加载谷歌地图

    我想在单击链接后显示 Google 地图 我已经尝试过以下方法 当点击链接时 然后 Insert div与 id 链接后map 使用 jQuery 方法 getScript 加载 Google Maps API 添加谷歌地图到div带身份证
  • VueJS 中数据无法正确显示

    我的 VueJS 代码有一个小问题 在 输出 压缩的 GS1 数字链接 URI 部分中 When there is no result it should have nothing display like this I have remo
  • 防止垃圾邮件按钮呼叫功能

    如何防止调用函数时出现垃圾邮件按钮 就像用户只能在按钮上每 1 秒调用一次该函数 有办法做到吗 因为我尝试了 setTimeout 但没有成功 它仍然在发送垃圾邮件 顺便说一句 我使用 Jquery 这是我的代码
  • 如何使用Android opencv使图像的白色部分透明

    我无法链接超过 2 个网址 因此我将我的照片发布到此博客 请在这里查看我的问题 http blog naver com mail1001 220650041897 http blog naver com mail1001 220650041
  • 滚动时的 CSS 背景模糊

    我有固定的背景图像 滚动时我希望图像变得模糊 我知道如何在 css 中进行模糊 但在特定的滚动位置进行 这是一个例子 https medium com good music f160ba9e6c52 https medium com goo
  • JQuery UI Selectable 插件:当 div 溢出时使滚动条不可选择

    我有一个 div 设置为overflow auto 该 div 的内容是可选择的 使用 jQuery UI 当 div 溢出并出现滚动条时 滚动条本身变为可选择状态 因此滚动效果不佳 在 FF Chrome 中 我可以滚动 div 但我得到
  • 访问图像的 Windows“标签”元数据字段

    我正在尝试进行一些图像处理 所以现在我正在尝试读取图像 exif 数据 有 2 个内置函数可用于读取图像的 exif 数据 问题是我想读取图像标签 exifread and imfinfo这两个函数都不显示图像标签 Is there any
  • 从 HTTP 登录到 HTTPS

    我的网站默认使用 HTTP 我确实有一个启用 HTTPS 的证书 但只有其上的某些区域强制建立安全连接 登录是通过 Ajax 处理的 我想开始使用 SSL 即使请求来自 HTTP 我尝试强制请求的地址具有 HTTPS 并且它完美地回复 然而
  • javascript 选择自定义光标 (svg)

    我正在动态地将光标更改为悬停时的本地 svg element on mouseover function this css cursor url svgs pointer svg 9 30 auto 工作正常 但我想选择该 svg 来操纵其
  • 使用 JavaScript 移动页面上的按钮

    我的按钮可以移动 但奇怪的是 我无法弄清楚偏移是否有问题 我希望我的按钮随着鼠标光标移动 但现在它的移动方式不是我想要的 有时它会消失 另外 创建的新按钮是重叠的 我不知道如何解决这个问题并拥有更好的外观 var coorA var coo
  • 如何停止TinyMCE删除span标签?

    在我的工作中 前一位程序员决定使用公司网站上精彩的TinyMCE 我遇到的数千个问题之一是 如果原文有的话span标签 当我按下退格键删除一行 p仅标签 全部span标签已从文本中删除 这个错误比另一个错误更具体 我可以删除anything
  • 使用 CSS 的响应式图像

    我发现调整图像大小以使其具有响应能力很棘手 我正在开发一个 php 应用程序来自动将网站转换为响应式版本 我有点被图像困住了 我已经成功地为网站上的每个图像添加了一个包装类 并且可以很好地调整图像的大小 我的问题在于自然小于窗口的图像 例如
  • 用于选择特定 div 中具有特定类的锚元素的 jQuery 选择器是什么

    我有一些这样的代码 我想选择每个 a 带有类的标签status在 div 中foo div a class status a div 你可以这样做 foo find status a
  • 主页(网格)上的缩略图现在显得模糊。如何纠正?

    我不知道这看起来是否愚蠢 但从早上开始我就无法纠正这个突然出现在我的博客网站上的错误www candidopinions in http www candidopinions in 我有一个网格视图模板 其中博客文章中的特色图像作为调整大小
  • Highcharts jQuery 渲染问题 - 所有浏览器

    我在尝试使用构建堆积柱形图时遇到了一个奇怪的问题高图表 http www highcharts com 当图表呈现时 在您调整浏览器大小之前 不会显示列无论如何 导致图表重绘 我认为 图表的其余部分显示 轴 标题等 但不显示列本身 我在 I
  • 滚动顶部不符合预期

    Note 由于上次忘记奖励而重新开放赏金 A Woff 大师已经给出答案 我想在用户展开某一行时到达该行 这样当最后一个可见行展开时 用户不必向下滚动即可查看内容 I used example tbody on click td green
  • 禁用允许文本选择的

    残疾人可以吗

随机推荐

  • 使用 R 下载 gzip 数据文件、提取和导入数据

    后续行动这个问题 https stackoverflow com questions 3053833 using r to download zipped data file extract and import data 如何使用 R 下
  • 通过 lambda 从另一个集合中排除集合

    这是我的类型 public class myType public int Id get set public string name get set 这种类型有 2 个集合 List
  • 在 Perl 中,如何访问另一个包中定义的标量?

    我似乎被困在尝试访问另一个包中定义的标量 并将示例缩小为一个简单的测试用例 我可以在其中重现问题 我希望能够使用我们的机制访问对 Example 包中定义的列表的引用 但是 Dumper 显示该变量在 example pl 中始终未定义 E
  • 从控制器返回 razor 解析的 Javascript 作为 ViewResult

    我已经成功创建了一个 mvc razor Web 应用程序 它返回已由 razor 解析的 css 文件 每次有背景图像时 我都会有一个 razor 片段 它将 URL 前缀写入图像文件名 CSS 现在看起来像这样 body backgro
  • 自定义后退按钮标题并保留滑动返回手势

    问题 我想在弹出的视图控制器中自定义导航后退按钮标题 例如 Whatsapp 但是 如果您使用 在弹出视图控制器中分配新的 backBarButtonItem 将禁用向后滑动手势 self navigationController inte
  • Active Directory 跨域 - 使用PrincipalContext 的组成员

    我试图通过使用 C 中的 DirectoryServices AccouneManagement 命名空间类来获取给定活动目录组的成员 如果我为特定域指定了主体上下文对象构造函数 那么每当我访问来自其他域的组中的成员时 我都会遇到以下错误
  • 为什么 Spark 中聚集和折叠两个不同的 API?

    当使用Scala标准库时 我可以这样做 scala gt val scalaList List 1 2 3 scalaList List Int List 1 2 3 scala gt scalaList foldLeft 0 acc n
  • 你能写一个到锚点的 301 重定向吗?

    这是有效且正确的吗 RewriteRule myOldPage html index php info R 我特别感兴趣的是 info part 是的 这是一个有效的 301 重定向 HTTP标准 http www w3 org Proto
  • 通过 OR 或 AND 连接(粘合)where 条件(Arel、Rails3)

    我有一些complex查询 使用子查询等 并希望使用 OR 或 AND 语句将它们粘合在一起 例如 where1 table where where2 table where 我想要类似的东西 where3 where1 or where2
  • iPhone 开发 - 内存管理经验教训

    我需要内存管理方面的课程 我有一个使用多个视图 大约 10 个 的应用程序 其中一些附加到选项卡控制器 问题是我正在使用图像 许多图像是我从网络服务加载的 我面临以下问题 当我在表视图中滚动时 内存不断增加 为什么 我从 Apple 网站检
  • 如何将 aria 标签分配给侧边栏

    我正在使用 Siteimprove 的 chrome 扩展浏览客户的网站来测试合规性 我在一个侧边栏区域的两侧收到 具有相同名称的地标 错误 在functions php的注册侧边栏代码中 我有 before widget gt
  • 如何使用单个按钮创建 Firefox 插件(与 Echofon 相同)?

    I want to how to create Firefox plugin with custom compact menu same like Firefox window Just now I saw in Echofon Here
  • 显示列表视图时在后台下载图像

    我有一个列表 其中包含我在列表中显示的图像的所有 URI 现在我想在后台运行一个线程 从网络获取这些图像并将它们存储在 SD 卡上 因此 当我单击列表中的特定元素而不是从 Web 获取时 它应该从新活动中的 SD 卡获取 我该怎么做呢 Yo
  • 图书馆插件:: 找不到图书馆资源

    我目前正在将 Android 库转换为 Unity 插件 我已经走了很长一段路 但现在我陷入了无法从 Unity 访问库资源的地步 应用程序运行良好 直到我实际从库中调用视图 这是我当时收到的错误日志 12 12 13 37 36 495
  • iPhone 12 和 iPhone 13 上的颠倒方向

    我有一个 iOS 应用程序 可以在运行 iOS 15 6 的 iPhone 7 上上下旋转 然而 同一个应用程序在运行 iOS 15 6 1 的 iPhone 13 或 iPhone 12 上不会上下旋转 Apple 是否在较新的设备或 i
  • Android 中“FLAG_BLUR_BEHIND”的替代方案?

    我可以看到 当我使用 API 演示中所示的相同标志来模糊背景时 我收到一条警告 表明它已被弃用 字段 WindowManager LayoutParams FLAG BLUR BEHIND 已弃用 我读过相关内容 发现 不再支持模糊 这是否
  • 重新创建 Fabric.js 画布并导出为图像?

    我有一个画布 用户可以在其中使用另一个画布中的图像创建设计div他们点击 将其发送到 Fabric js 画布 并在其中移动等等 由于画布的大小是width 270 and height 519 比成品小 我需要用尺寸为的画布重新创建它wi
  • 使用 Apple Enterprise Developer Program 部署 iOS 应用程序

    我已经为我需要部署的公司创建了一个应用程序 该应用程序仅供内部使用 因此不会在 App Store 上提供 我是否需要为要在其设备上安装应用程序的每个人提供 UDID 这是不可能的 因为有 500 名员工 是否有人拥有有关仅使用企业开发人员
  • 指定 64 位对齐

    给定一个结构定义 例如 struct foo int a b c 指定它应始终与 64 位地址对齐的最佳 最简单 最可靠和可移植 方法是什么 即使在 32 位版本上也是如此 我正在使用 C 11 和 GCC 4 5 2 并希望也支持 Cla
  • 上传的图像在canvas中拖动,在html5中可触摸和旋转

    我是 Html5 的新手 我正在上传图像 但它没有显示在画布中 如果我提供图像的直接来源 那么它将起作用 我从此链接获取帮助javascript 上传图像文件并将其绘制到画布中 https stackoverflow com questio