scale

Zoom/scale from different point of image in canvas

半城伤御伤魂 提交于 2019-12-25 09:04:22
问题 I have made a canvas in html5. I'm using it to show parts of a bigger image that you can move and I want to make it possible to zoom both in and out. But I do not know how to make the image scale from a certain point. When I increase the size of the image the part which is shown by the canvas is moved, I want the part in the center of the canvas to be the focus point when the scaling is complete, but no matter how I try it gets distorted some how. It seems like depending on which part of the

d3 quantile scale force first quantile

雨燕双飞 提交于 2019-12-25 06:44:27
问题 I'm building a heat map with a color gradient from green to red. I want cells with value 0 to be green, and values greater or equal than 1 to take the other colors. I'm building the scale this way : var colors = [ '#27C24C', '#7DB22E', '#D4A10F', '#F97C20', '#F35F40', '#FF0000' ]; var colorScale = d3.scale.quantile() .domain([0, d3.max(data, function (d) { return d.value; })]) .range(colors); But this returns me the following quantiles : [239.16666666666677, 478.3333333333332, 717.5, 956

Webview - setInitialScale prevent scrollTo to scroll the Webview

删除回忆录丶 提交于 2019-12-25 05:34:10
问题 I'm developing an application for serious of books by using Webview with local html files. I want to allow the user to return to the last location that he read with the same font size that he choose. Font size - I'm using getScale to store the choosing scaling when the user close the App, and when the user open the App I'm loading it by using the setInitialScale with the stored scaling. It works good. Location - I'm using getScrollY to store scrolling when the user close the App, and when the

Scale :before when hovering

半城伤御伤魂 提交于 2019-12-25 04:07:33
问题 I'm trying to scale the :before content of my <span> when hovering over it. So far the style gets applied when hovering but there are no visual changes, the :before remains the same scale. What I've got so far: <div class="comment-actions"> <span class="comment-likes icon-ico-heart"> 12 </span> </div> SASS (CSS): .comment-likes transition: all 100ms ease-in-out color: #92a3b9 cursor: pointer &:hover::before transform: scale(1.5) Icomoon: .icon-ico-heart:before { content: "\e914"; } [class^=

issue with viewport meta tag

一个人想着一个人 提交于 2019-12-25 03:59:29
问题 I need my website to adjust itself according to the device. I used the following viewport meta tag: <meta name="viewport" content="user-scalable=no,width=device-width, height=device-height, minimum-scale=0.1, maximum-scale=0.65" /> It works alright on iPhone. but on android it looks it doesn't responded to it at all even when I change the scale values. Is there a different tag for android? 回答1: You should use the same tag for Android, but there are a few differences how different platforms

Kivy: export_to_png() with an arbitrary scale

戏子无情 提交于 2019-12-25 03:08:16
问题 Is there a way to export a widget to png with an arbitrary scale in Kivy? As far as I understand, now by default the scale of an exported image is 1:1 relative to size of widget that I see on the screen. But what if I want to export to 1:10 (and get an image 10 times larger)? Interested in any ideas how this can be done. 回答1: I don't know a straight forward method to do the same, but you can fork export_to_png method of Widget class Here is a working example: from kivy.uix.widget import

R ggplot focusing in region and different scale in one axis

家住魔仙堡 提交于 2019-12-25 02:24:15
问题 I googled but can't find an answer to my problem. I have some dates: date for temperature (region at 30 to 60 gr Celsia) date for consumption in Watt (region at 100 to 160 Watt) date for frequency in GHz (region at 1.2 to 3.1 GHz) Then I plot these dates in one graphic I cant see different in frequency (it so small). How add to axis ticks like 1.2 to 3.1 with step 0.1 and after return to step 10? And how to add scale for region like 1.2 to 3.1 (it will be so big as step with 10 else I cant

How to scale inline SVG

主宰稳场 提交于 2019-12-25 01:49:31
问题 I want to scale inline SVG document in html. I have code like this: var svg_width = svg.attr('width'); var svg_height = svg.attr('height'); function resize(width, height) { svg.attr('width', width).attr('height', height); var group = svg.find('#resize_group'); if (!group.length) { group = svg.children().not('metadata, defs').wrapAll('<g/>'). parent().attr('id', 'resize_group'); } var matrix = svg[0].createSVGMatrix(); //var matrix = group[0].getCTM(); matrix.a = width/svg_width; matrix.d =

Cycle scaled webpages in iframe?

限于喜欢 提交于 2019-12-24 23:14:31
问题 I'm trying to combine code from two questions previously asked here before. How can I cycle through pages? I want to use this code to create a kiosk and cycle through webpages. I also want to use How can I scale the content of an iframe? this to scale the content of the iframe. Ideally I would like to scale each page by a different factor, but if this is not possible then I will use a static value. On a side note, is it possible to scale the page automatically to a certain screen resolution

Scale all images to fit container proportionally

老子叫甜甜 提交于 2019-12-24 20:13:03
问题 I am building a customization script where a user can upload an image and drag it around a template image to get a desired result. The problem is the template image is over 1000px tall and wide, so I put it inside a container limiting it's height/width. How do I make it so the uploaded image is scaled exactly the same so when I create the image via PHP I can take the left: and top: CSS values and apply them to the much larger template image and uploaded image? Current CSS: #template {