scaling

Mobile Safari renders <img src=“data:image/jpeg;base64…”> scaled on Canvas?

守給你的承諾、 提交于 2019-12-17 15:42:41
问题 I try to render a local image loaded with a FileReader object on a Canvas on Safari Mobile on iOS6. But every image with data-URL gets rendered vertically scaled. Is this a bug? On Chrome it's rendered correctly. Demo Script ScreenShot from iOS6 (above: Canvas, below: Original Image) Is there any way to work-around this bug? Is this a bug? If I resize the image on the device first with the "PhotoWizard" App (scale it down to 720px width), the Canvas renders it correctly. It seems to be a

How to scale images on a html5 canvas with better interpolation?

最后都变了- 提交于 2019-12-17 15:24:32
问题 First of all: what am I trying to do? I have an application to view images. It uses the canvas element to render the image. You can zoom in, you can zoom out, and you can drag it around. This part works perfectly right now. But let's say I have an image with a lot of text. It has a resolution of 1200x1700, and my canvas has 1200x900. Initially, when zoomed out, this leads to a rendered resolution of ~560x800. My actual drawing looks like this: drawImage(src, srcOffsetX, srcOffsetY,

Android imageview not respecting maxWidth?

牧云@^-^@ 提交于 2019-12-17 10:19:14
问题 So, I have an imageview that should display an arbitrary image, a profile picture downloaded from the internet. I want this the ImageView to scale its image to fit inside the height of the parent container, and a set max width of 60dip. However, if the image is tall ratio-wise, and doesn't need the full 60dip of width, the ImageView's width should decrease so the view's background fits snugly around the image. I tried this, <ImageView android:id="@+id/menu_profile_picture" android:layout

Why isn't my vector drawable scaling as expected?

試著忘記壹切 提交于 2019-12-17 10:11:45
问题 I am attempting to use vector drawables in my Android app. From http://developer.android.com/training/material/drawables.html (emphasis mine): In Android 5.0 (API Level 21) and above, you can define vector drawables, which scale without losing definition. Using this drawable: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:width="24dp" android:viewportWidth="24" android:viewportHeight="24"> <path android:fillColor="@color/colorPrimary" android

How to scale SVG image to fill browser window?

夙愿已清 提交于 2019-12-17 04:44:33
问题 This seems like it ought to be easy, but I'm just not getting something. I want to make an HTML page containing a single SVG image that automatically scales to fit the browser window, without any scrolling and while preserving its aspect ratio. For example, at the moment I have a 1024x768 SVG image; if the browser viewport is 1980x1000 then I want the image to display at 1333x1000 (fill vertically, centred horizontally). If the browser was 800x1000 then I want it to display at 800x600 (fill

Android and setting width and height programmatically in dp units

烂漫一生 提交于 2019-12-17 03:46:03
问题 I'm doing: button.setLayoutParams(new GridView.LayoutParams(65, 65)); According to the docs the units for the width and height (both 65 in the above) are "pixels". How do you force this to be device independent pixels, or "dp"? 回答1: You'll have to convert it from dps to pixels using the display scale factor. final float scale = getContext().getResources().getDisplayMetrics().density; int pixels = (int) (dps * scale + 0.5f); 回答2: I know this is an old question however I've found a much neater

Scaling of a rotated element

自古美人都是妖i 提交于 2019-12-13 16:50:26
问题 Let's suppose I have an element that I want to rotate and scale in a visual designer: A user should be able to drag the edges and the graphics should scale appropriately. The rotation is entered in degree. Following fact is an issue with rotated element: When the top left point is dragged not only the width and height will change, but the top left position as well. When the top right point is dragged then the size changes, and the Y-Position as well If the element is rotated however (WPF

css - using media queries to scale content

一个人想着一个人 提交于 2019-12-13 08:24:04
问题 I'm wondering if there is a way to use media queries to scale a divs contents (not the entire browser's contents). I have a fluid width site in which, when the window resizes past a certain point, some of the content gets buried behind some other content, and I'd like to be able to scale it. I have two issues - one is that I'm using ems for the fonts, but the fonts don't scale as the browser resizes. Are they supposed to? Second, some of the contents of the div I'd like to resize are images -

Scaling 3D models, finding the origin

孤者浪人 提交于 2019-12-13 07:10:57
问题 To get a better idea of how matrix transformations work cause I'm having a fairly hard time seeing what actually happens, I decided to write some scripts that will take a 3D model and then do some translations, rotations, and scaling, since looking at what actually happens when I play around with different values may be helpful. I've already written the scripts to parse a 3D model, so now I just need to write the transformation functions. I am using the Euclid module, which was amongst

how to partition graph for pregel to maximize processing speed?

荒凉一梦 提交于 2019-12-13 03:58:50
问题 I have a crowdsourcing application. data from users is collected and then processed and then updated for everyone to see. The data collection is almost real time. The processing speed is increasing as the users (data nodes) are increasing. I need to scale this. Looking at scaling for graph based models, mapreduce seems to be famous. Is there a benchmarking paper comparing it to other techniques? Pregel is impressive. Please point me to any leads about 'partitioning' in pregel i.e, how a graph