scaling

Android Screen-size and Screen-density Image Selection

末鹿安然 提交于 2019-12-12 15:54:11
问题 I am having problems when trying to use multiple horizontal images on different size devices. I have 7 separate Ratingbars, each using a different custom image. I have scaled all the images and placed them into their respective dpi drawable folders. The problem I'm having is that on the xlarge mdpi screen (top left of the image below), they fit perfectly, but when I'm viewing them on a smaller screens, the entire 7 ratingbars are too wide to fit within the bounds of the device, as shown below

Setting “tk scaling” in Tkinter affects widgets but not text

心已入冬 提交于 2019-12-12 15:17:19
问题 I'm trying to use Tk's "tk scaling" feature to zoom a GUI but it only seems to change the size of the widgets, not the text. Is it possible to use "tk scaling" with Tkinter and have it work appropriately? Here's my test script: #!/usr/bin/python from Tkinter import * root = Tk() root.tk.call('tk', 'scaling', '-displayof', '.', 50) root.geometry('640x480+0+0') label = Label(root, text='THis is some text') button = Button(root, text='my button', command=root.quit) label.pack() button.pack()

Differences between BitmapFactory.decodeResource and BitmapFactory.decodeStream

不想你离开。 提交于 2019-12-12 12:33:45
问题 I've got an if-else scenario where the if-path uses this code: BitmapFactory.Options options = new BitmapFactory.Options(); options.inScaled = false; options.inPurgeable = true; options.inInputShareable = true; bitmap = BitmapFactory.decodeResource(getResources(), resourceId, options); And the else-path uses this code: InputStream is = getContentResolver().openInputStream(Uri.fromFile(file)); BitmapFactory.Options options = new BitmapFactory.Options(); options.inScaled = false; options

Algorithm for self-scaling ruler in plotter GUI component

爱⌒轻易说出口 提交于 2019-12-12 08:57:50
问题 I am designing (not programming) a data-series viewer program for medical data, using C#/WPF. There is one main panel which shows the data, with the common mouse pan/zoom functionality (pan with left drag, horizontal zoom with scroll, vertical auto-fit with double click, selection with right drag). The problem is: I need vertical and horizontal grid with rulers on the top/left, similar to those seen in audio-editing (goldwave, audacity), cartography (gpsTrackmaker) and ilustration (photoshop,

Using matplotlib, how can I print something “actual size”?

可紊 提交于 2019-12-12 07:19:15
问题 I have a number of plots where the x- and y-axes are in centimeter units, and I am already using axis('equal') to ensure proper aspect ratios. I would like to print out those plots so that when I measure distances within my axes, the distances correspond to real-world centimeters. That is, a line that is 3 units (cm) long in the plot should print out to be 3 cm long. (A more complex example would be drawing a ruler in Matplotlib, and then printing it out for use /as/ a ruler.) I found

Inappropriate scaling factor when editing PDF and displaying image in UIWebView

こ雲淡風輕ζ 提交于 2019-12-12 05:19:22
问题 I'm struggling with PDF editing so I'm starting with naive code trying to achieve the following : Display a PDF bundled with app Click on screen where I want to add my image (Signature for example) Reload the webview with the edited PDF Here is my code on github : https://github.com/HRiffiod/PDFSignature.git The problem is that my image does not display at the right position in the edited PDF. It is not random, but the farther I get from the (0,0) coordinates, the bigger the deviation, that's

How to scale a number/range of numbers in c

∥☆過路亽.° 提交于 2019-12-12 05:09:29
问题 I want to be able to display the altitude in ft ranging from 0ft to 20000ft on my LCD module. The numbers are read from a potentiometer that I can rotate to change the values. At the moment the potentiometer displays from 0 to 1023 but I need to scale these appropriately so they read from 0-20000ft. As well as this I want the line below to display a 'bar graph' to represent the altitude increasing. The LCD has 20 blocks per line so the bar graph can range from 1 block to 20 blocks. sprintf

Unable to create new native thread error when invoking lambda function on dynamodb table - how to avoid?

自古美人都是妖i 提交于 2019-12-12 05:05:47
问题 I have a lambda function that queries some DynamoDB tables and returns some entries in them. Invoking it a few times and all is fine, but I am now stress testing my back end and when I invoke this function over and over in a short period of time, I get the following error: "errorMessage":"unable to create new native thread","errorType":"java.lang.OutOfMemoryError" I am using DynamoDB's spatial indexing capabilities, and the error message seems to be suggesting that a line to do with the

Scale scrollview contents to fill screen

时光总嘲笑我的痴心妄想 提交于 2019-12-12 00:49:52
问题 I've a scrollview that displays a few bitmap imageviews to fill the screen. To support larger screens, I just want to scale the images. If I place a single imageview in the scrollview, it scales to fit (fill_parent). However, adding a second imageview underneath causes the imageviews to revert to actual size and not be upscaled to fill the screen. <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/menu_ground" android

KineticJS image annotation tool accross devices

末鹿安然 提交于 2019-12-11 19:48:50
问题 We have made an Image annotation tool in one of our cross platform apps (phonegap app), we have been able to get the tool working using KineticJS. Its a great API. But we have a small problem. Here is the scenario: If say i have 10 images on which i did some annotation, and saved the layer as JSON string in say sqllite for each image. Synced my sqllite with server. on page load, checked the server, pulled the layer json, deserialized the json, and added it over the image canvas. The approach