DrawArc上的图像,定位问题(DrawArc on image, positioning issue)
我有一个可测量的标尺,我试图在它上面画一条线。 (固定位置,不是固定值)
不幸的是,我没有任何绘画经验。 (我认为它很难理解)
目前看起来像这样: https : //i.stack.imgur.com/5tkXEl.png
正如你所看到的,它没有定位正确,我很害怕在其他设备上看它。
代码(Class extends View):
private void init(Context context) { bounds = new Rect(); gaugeBackground = ContextCompat.getDrawable(context, R.drawable.gauge); arcPaint = new Paint(Paint.ANTI_ALIAS_FLAG); arcPaint.setColor(Color.RED); arcPaint.setStyle(Paint.Style.STROKE); arcPaint.setStrokeWidth(7f); } protected void onDraw(Canvas canvas) { canvas.getClipBounds(bounds); gaugeBackground.setBounds(bounds); gaugeBackground.draw(canvas); float padding = 5; float size = getWidth() < getHeight() ? getWidth() : getHeight(); float width = size - (2 * padding); float height = size - (2 * padding); float radius = (width < height ? width /2 : height /2); float rectLeft = (width /2) - radius + padding; float rectTop = (getHeight() /2) - radius + padding; float rectRight = (getWidth() /2) - radius + padding + width; float rectBottom = (getHeight() /2) - radius + padding + height; RectF mRect = new RectF(rectLeft, rectTop, rectRight, rectBottom); canvas.drawArc(mRect, 119f, 300f, false, arcPaint); }
有人能提供有用的信息吗? 我希望我终于得到整个RectF /绘图的东西..
I have a drawable of a gauge and I try to draw a line on it. (Fixed position, not fixed value)
Unfortunately I don't have any experience with drawing. (And I think its hard to understand)
At the moment it looks like this: https://i.stack.imgur.com/5tkXEl.png
As you can see, its not positioned right and I'm quite afraid of looking at it on other devices.
Code (Class extends View):
private void init(Context context) { bounds = new Rect(); gaugeBackground = ContextCompat.getDrawable(context, R.drawable.gauge); arcPaint = new Paint(Paint.ANTI_ALIAS_FLAG); arcPaint.setColor(Color.RED); arcPaint.setStyle(Paint.Style.STROKE); arcPaint.setStrokeWidth(7f); } protected void onDraw(Canvas canvas) { canvas.getClipBounds(bounds); gaugeBackground.setBounds(bounds); gaugeBackground.draw(canvas); float padding = 5; float size = getWidth() < getHeight() ? getWidth() : getHeight(); float width = size - (2 * padding); float height = size - (2 * padding); float radius = (width < height ? width /2 : height /2); float rectLeft = (width /2) - radius + padding; float rectTop = (getHeight() /2) - radius + padding; float rectRight = (getWidth() /2) - radius + padding + width; float rectBottom = (getHeight() /2) - radius + padding + height; RectF mRect = new RectF(rectLeft, rectTop, rectRight, rectBottom); canvas.drawArc(mRect, 119f, 300f, false, arcPaint); }
Can someone provide helpful information? I hope I finally get the whole RectF/Drawing stuff..
原文:https://stackoverflow.com/questions/41675246
最满意答案
这完全是完全下载。 这严格依靠端点。
你不能真正推断像安装/恢复等事情
原因在于NuGet客户使用的优化,以及开发人员的开发环境。
NuGet客户端拥有全局包文件夹 ,这基本上意味着理想情况下每个机器只能下载一个包(人们可以为不同项目配置不同的全局包文件夹等)。
接下来,项目有CI设置,那里的配置也很重要。
- 他们是否重新生成构建机器?
- 他们在每次运行之前清理全局包文件夹吗?
另一个需要注意的是,你不能推断你的软件包的直接使用情况,还有一个更受欢迎的软件包依赖于它。
基本上,不幸的是,目前没有办法了解每个项目/每个唯一用户使用您的软件包的情况。
It's quite literally total downloads. This is strictly counting on the endpoint side.
You can't really infer things like installations/restore etc.
The reason for that is the optimizations that the NuGet clients employ, and simply the development environment of the developer.
The NuGet client has the global packages folder which basically means that a package would be downloaded only 1 per machine ideally (people may configure different global packages folders for different projects etc).
Next, projects have CI set-up, the configuration there matters as well.
- Do they reimage the build machine?
- Do they clean the global packages folder before each run?
Another caveat is that you can't infer direct usage of your package vs having a significantly more popular package depend on it.
Basically, the gist is, unfortunately no, there's currently no way you can understand the per project/per unique user usage of your package.
相关问答
更多-
上周NuGet 3.4更新后,我发生了问题。 解决方案是删除'%AppData%\ NuGet \'中的'NuGet.Config'文件,当您再次启动VS2015时,它将创建一个新的默认配置文件。 详细说明请参见: https : //docs.nuget.org/Release-Notes/Known-Issues 工作配置文件:在Visual Studio中启动软件包管理器控制台 - 它在Tools / NuGet软件包管理器/软件包管理器控制台中。 然后运行Install-Package命令: Install-Package Common.Logging -Version 1.2.0 详细信息请参见命令参考 。 编辑:为了列出包的版本,您可以使用Get-Package命令与 remote参数和 过滤器: Get-Package -ListAvailable -Filter Common.Logging -AllVersions ...
下载并将所有nuget软件包从on premis TFS推送到vsts(download and push all nuget packages from on premis TFS to vsts)[2022-03-13]
请参阅此文章移动包: 移动包 Refer to this article to move packages: Move your packages虽然建立网址或使用工具仍然可行,但不再需要。 https://www.nuget.org/目前有一个直接下载链接 ,即使您没有在该网站上的帐户也是可用的。 (位于左侧列的底部 - 仅在统计信息和其他链接之下)。 EntityFramework的详细页面示例: https : //www.nuget.org/packages/EntityFramework/ Although building the URL or using tools is still possible, it is not needed ...从问题的评论中,我可以使suave webserver工作。 我将下载的软件包复制到我收集nuget软件包的地方( /bin/mono/ )。 然后,我制作了F#脚本(hello.fsx)。 #r @"/bin/mono/Suave.0.24.0/lib/net40/Suave.dll" open Suave // always open suave open Suave.Http.Successful // for OK-result open Suave.Web ...这完全是完全下载。 这严格依靠端点。 你不能真正推断像安装/恢复等事情 原因在于NuGet客户使用的优化,以及开发人员的开发环境。 NuGet客户端拥有全局包文件夹 ,这基本上意味着理想情况下每个机器只能下载一个包(人们可以为不同项目配置不同的全局包文件夹等)。 接下来,项目有CI设置,那里的配置也很重要。 他们是否重新生成构建机器? 他们在每次运行之前清理全局包文件夹吗? 另一个需要注意的是,你不能推断你的软件包的直接使用情况,还有一个更受欢迎的软件包依赖于它。 基本上,不幸的是,目前没有办法了解每个项目 ...如何弃用nuget包(How to deprecate a nuget package)[2022-03-17]
如果您不拥有nuget服务器,则唯一的选择是将“已弃用”添加到说明中: https://www.nuget.org/packages?q=deprecated 如果您有私人nuget服务器,您也可以启用除名: 作为“nuget delete”命令的结果,将enableDelisting设置为true以启用删除而不是删除。 删除:将软件包从存储库的本地文件系统中删除。 摘牌: “nuget delete”:存储库本地文件系统上相应nupkg的“隐藏”文件属性开启,而不是删除文件。 “nuget list”跳过 ...NuGet在通过Visual Studio下载包时使用哪个端口(Which port is used by NuGet while downloading package through Visual Studio)[2022-05-24]
https://nuget.org/api/v2/表示端口443(HTTPS的标准端口) 如果您在公司网络上,则端口80和443通常通过代理服务器退回。 最有可能的是,NuGet由于某种原因未使用您的代理设置,因此无法找到代理服务器并被公司防火墙阻止。 https://nuget.org/api/v2/ means port 443 (the standard port for HTTPS) If you're on a corporate network, port 80 and 443 are usua ...我们有两个不同的存储库,其中的包共享相同的ID,相同的版本,不同的内容。 从列表中删除错误的repo解决了这个问题。 We had two different repositories with packages sharing the same id, same version, different content. Removing the wrong repo from the list solved the problem.原来答案是否定的。 请参阅此GitHub问题https://github.com/NuGet/Home/issues/1829 Turns out the answer is no. See this GitHub issue https://github.com/NuGet/Home/issues/1829相关文章
更多- C#中Image.FromFile()的用法
- 《C/C++图像处理编程》扫描版[PDF]
- PHP生成带LOGO的二维码图像
- 微信定位真的泄露了你的精确位置
- JFreeChart笔记 (四) 时间序列图:自动定位时间点
- 方雨:微信营销的目的、定位、营销方式?
- 比预想严重:FireFox现图像处理漏洞
- HBuilder代码定位-跳转到class、id、js方法定义处
- HTML5 Canvas 图像动画的实现
- 创业定位决定运营
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。