scale

Scale bitmap through Seekbar

跟風遠走 提交于 2019-12-12 04:12:52
问题 I am using seekbar to scale the image. The image is scaled to one specific size, where ever you take the seekbar and its scaled for the once, next time you change the progress of seekbar the image remains in same changed size. I want to scale it dynamically with the increase or decrease of seekbar progress. Seekbar code snippet seekBar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar arg0) { // TODO Auto-generated method stub }

Scale a rectangle in html and css

不打扰是莪最后的温柔 提交于 2019-12-12 03:33:41
问题 I want to make a rectangle (a div) with a specific scale. The height-width scale has to be 30:50. The rectangle fills 40% of the width-screen. If I resize my screen, how can I change the height if you keep the scale in mind? HTML: <div id="bg"> </div> CSS: #bg { background-color: blue; width: 40%; } 回答1: Try scaling it using vw (viewport width): #bg { background-color: blue; width: 40vw; height: 66.67vw; } https://jsfiddle.net/gmsitter/9tpbq30x/1/ 来源: https://stackoverflow.com/questions

How to disable Chart axis autosize

放肆的年华 提交于 2019-12-12 02:55:25
问题 I need to stop autosizing (or autoscaling) of Y Axis in c# chart and set it manually. Any advice? Thanks 回答1: You can set the minimum and maximum of the Y axis like so: chart.ChartAreas[0].AxisY.Minimum = 0; chart.ChartAreas[0].AxisY.Maximum = 10; 来源: https://stackoverflow.com/questions/9412781/how-to-disable-chart-axis-autosize

Android display Dimensions and Drawable size scaling

本小妞迷上赌 提交于 2019-12-12 02:52:14
问题 It is the next stage of: Scale and align in custom android AnalogClock hands ...this one. Soon I realized that a Drawable can not be scaled, if it fits the size box, then it will be displayed. Otherwise not. So now I need a Bitmap to scale it and then convert back to Drawable and draw it. It doesn't seem elegant, but according to what I found, I don't see any other way. (Idea is to create own alarm app with some special tricks. Firstly, I need clock hands. For creating custom clock, I used

Image from resources is scaled properly but image blob from SQlite isn't - Android

拟墨画扇 提交于 2019-12-12 02:44:04
问题 I am running into a strange issue. I have multiple images in my Android project which I stored as .png files under res\drawable. I was able to easily extract the images at runtime and convert them to a bitmap like this: Drawable d = getResources().getDrawable(R.drawable.imageId); Bitmap bitmap = ((BitmapDrawable)d).getBitmap(); This works great and the image gets scaled correctly no matter what screen density the device has. All my images are 200 pixels by 200 pixels and my image layout is

Android - Resizing bitmap cuts it instead of scaling it

自古美人都是妖i 提交于 2019-12-12 02:29:38
问题 I have an application where the user can draw to a view whose dimensions are W = Match Parent and H = 250dp. I need to resize it to W = 399pixels and H = 266pixels so I can print it properly via a bluetooth thermal printer. I am getting the desired dimensions of the resized image, however, the output I get is a chopped version of the original whose dimensions are the scaled dimensions I want. This is the code I use to get the data from the view and resize it. Bitmap bitmap = Bitmap

java JFrame scaled UI display with virtual drawing space

情到浓时终转凉″ 提交于 2019-12-12 02:28:43
问题 i have an application that has graphics which are thought to be displayed at 1024x768. I want to make the application flexible in size without rewriting all drawing code, position calculation etc.. To achieve that my attempt was overriding the paint method of the JFrame container in the following way: @Override public void paint(Graphics g) { BufferedImage img = new BufferedImage(this.desiredWidth, this.desiredHeight, BufferedImage.TYPE_INT_ARGB); Graphics2D gi = (Graphics2D) img.getGraphics(

Keeping the aspect ratio of ImageViews in a LinearLayout in a HorizontalScrollingLayout

被刻印的时光 ゝ 提交于 2019-12-12 01:19:49
问题 I have code that adds a variable number of images into ImageViews from an ArrayList. These then get added as views to a LinearLayout, which is in a HorizontalScrollingLayout. My code is as follows: My Activity class - LinearLayout gallery; ... gallery = (LinearLayout) findViewById(R.id.viewvehiclegallery); ... gallery.removeAllViews(); for (Photo _photo : vehicle.getPhotoArrayList()) { ImageView newImage = new ImageView(getApplicationContext()); newImage.setBackground(new BitmapDrawable

diverging size scale ggplot2

我只是一个虾纸丫 提交于 2019-12-12 00:46:36
问题 I am trying to map model/obs differences at locations in space. I have color mapped to the diff but I would also like to map size to diff. i'm currently mapping size to abs(diff) but it produces two different legends that I would like to combine. mapping size to diff creates small points for negative values and large points for positive values but I really only want the magnitude represented for over/under predictions. In case it makes a difference, I would also like the scales to be discrete

Android views not scaling on different sized devices

纵然是瞬间 提交于 2019-12-11 23:24:00
问题 I am using eclipse I have views with images and buttons with their width and height set in dp: <Button android:id="@+id/btn_menu_games" android:layout_width="70dp" android:layout_height="70dp" android:layout_gravity="center" android:background="@drawable/ico_games" android:onClick="goToGames" /> But when I use a different device the images and buttons do not scale relative to the screen, so they are really big on a small screen and really small on a big screen. Am I doing something wrong in