scaling

Setting ImageView ScaleType to “center” is not working as I expect it

半城伤御伤魂 提交于 2019-12-03 04:58:05
I have the following layout for my ImageView : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:descendantFocusability="blocksDescendants"> <ImageView android:id="@+id/imageview_icon" android:layout_width="48dp" android:layout_height="48dp" android:scaleType="fitCenter" /> (...) </LinearLayout> Those 48dp equal to 36px, 48px and 72px in ldpi , mdpi and hdpi respectively. All the images that will be used in this ImageView

Limit on number of git branches

廉价感情. 提交于 2019-12-03 04:45:44
I am musing about building a big system on top of git for various reasons but mainly convenience. But as part of the implementation I would end up making millions of branches and branching and merging between them. Can git actually scale this way? I always hear "Branches are free" but I have to wonder if this is really true x1,000,000? Can git actually create a theoretical unlimited number of branches? Yes, branches are free. Branching and merging is very easy. The scalability issues mentioned before comes only when synchronizing a vast amount of branches through the network (git fetch, git

iOS CAKeyFrameAnimation Scaling Flickers at animation end

自古美人都是妖i 提交于 2019-12-03 03:29:12
In another test of Key Frame animation I am combining moving a UIImageView (called theImage ) along a bezier path and scaling larger it as it moves, resulting in a 2x larger image at the end of the path. My initial code to do this has these elements in it to kick off the animation: UIImageView* theImage = .... float scaleFactor = 2.0; .... theImage.center = destination; theImage.transform = CGAffineTransformMakeScale(1.0,1.0); CABasicAnimation *resizeAnimation = [CABasicAnimation animationWithKeyPath:@"bounds.size"]; [resizeAnimation setToValue:[NSValue valueWithCGSize:CGSizeMake(theImage

iPad not scaling site down website correctly in portrait orientation

强颜欢笑 提交于 2019-12-03 03:18:26
This is a bit of an odd one and was wondering if anyone had a solution. We're building a few websites just now that are over 1000px in width and for some reason when the iPad loads them up in portrait mode it's scaling them down but leaving some width on the right so you have to scroll just a little over to see everything. I added <meta name="viewport" content="initial-scale=0.7;" /> which does fix the problem but when loaded in landscape the user is presented with a small site to start with and can zoom out too far. An example of this can be seen on one of my personal development sites. This

Distributed Concurrency Control

泪湿孤枕 提交于 2019-12-03 01:43:33
问题 I've been working on this for a few days now, and I've found several solutions but none of them incredibly simple or lightweight. The problem is basically this: We have a cluster of 10 machines, each of which is running the same software on a multithreaded ESB platform. I can deal with concurrency issues between threads on the same machine fairly easily, but what about concurrency on the same data on different machines? Essentially the software receives requests to feed a customer's data from

Scaling images in HTML with a minimum width/height in HTML/CSS only

孤街浪徒 提交于 2019-12-03 00:47:16
I have to display a bunch of images in a page. Images are of different size, some very wide and some very thin. I want to put them all in a container of fixed width and fixed height. The logic of placing the images should be like this: Say if image is smaller than the container, scale it up to the maximum size such that the aspect ratio is maintained, and put it at the center of container. If image is bigger, scale it down while maintaining the aspect ratio. Some examples: Say our container is 150x150, and we have an image sized 100x50. In this case the image should be scaled up to 150x75. If

How to create an ImageView that fills the parent height and displays an Image as big as possible?

旧巷老猫 提交于 2019-12-02 22:07:37
I have an ImageView that is defined in the following way: <ImageView android:id="@+id/cover_view" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_below="@id/title" android:layout_above="@id/divider" android:adjustViewBounds="true" android:src="@drawable/image_placeholder" android:scaleType="fitStart"/> Now after downloading a new bitmap I change the drawable. The image now appears in the top left corner of the ImageView. Is there a way to have the image fill up the whole height that is possible and then adjust the width of the view to enable scaling the

Full viewport height scaling div just css no js… Possible?

半世苍凉 提交于 2019-12-02 20:36:18
Ok, I'm trying to get a div to scale and the height is always the height of the viewport. I'm going to link to my examples as it needs some explaining. www.madmediablitz.com/tv/precentdemo.html The link above is the closest I've come to a solution and I'm hoping that someone here will find it simple to fix. What I want to happen is the tv to always be the height of the viewport (to a degree, min-height:~400px; max-height:~700px;). The code that I used there is based on http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ . www.madmediablitz.com/tv/precentdemo_alt.html This

Stackpanel: Height vs ActualHeight vs ExtentHeight vs ViewportHeight vs DesiredSize vs RenderSize

a 夏天 提交于 2019-12-02 18:08:29
i want to know the height of all items my StackPanel . What is the difference between: Height - Gets or sets the suggested height of the element. ActualHeight - Gets the rendered height of this element. ( readonly ) ExtentHeight - Gets a value that contains the vertical size of the extent. ( readonly ) ViewportHeight - Gets a value that contains the vertical size of the content's viewport. ( readonly ) DesiredSize - Gets the size that this element computed during the measure pass of the layout process. ( readonly ) RenderSize - Gets (or sets, but see Remarks) the final render size of this

Java rounding the results of a division when it shouldn't be

纵然是瞬间 提交于 2019-12-02 17:32:03
问题 So I have some code for scaling graphics to the size of a users screen by dividing the size of an 'Ideal' screen by the size of the users screen. Hers is a code snippet of what I'm doing: public void setScaleFactor(GameContainer ui) { scaleFactorWidth = 2880 / ui.getWidth(); scaleFactorHeight = 1800 / ui.getHeight(); System.out.println("Screen measured as: " + Integer.toString(ui.getWidth()) + "x" + Integer.toString(ui.getHeight())); System.out.println("Scale factors are: " + Double.toString