scale

How to make an image fit a custom 256dp Big Picture Notification in Android?

半世苍凉 提交于 2019-12-07 15:50:19
问题 I'm trying to fit (center and inside) 2 kind of images obtained from web services in a Big Picture styled Notification. One kind is 97px*150px sized and the other 300px*100px. As I checked the image must fit 256dp tall max height to fit on Jelly Bean's Big Picture notification visual area, so I expected that I can call the matrix scales availables on ImageView (fitXT, centerInside, etc) but i'm surprised that no scaling method behavior is available to configure and the bitmap is always center

Android how to get bounds of imageview with matrix

房东的猫 提交于 2019-12-07 13:58:02
问题 I have an ImageView with scaletype set to matrix, and would like to get a Rect with the bounds of the image after the transformation of the matrix. How do I get such a rect? thanks. 回答1: ImageView imageView = (ImageView)findViewById(R.id.imageview); Drawable drawable = imageView.getDrawable(); Rect imageBounds = drawable.getBounds(); Then use Matrix.mapRect. 来源: https://stackoverflow.com/questions/8590693/android-how-to-get-bounds-of-imageview-with-matrix

scale in data.table in r

谁说胖子不能爱 提交于 2019-12-07 09:18:15
问题 LC RC TOEIC eua again class 1: 490 390 880 90 0 100818 2: 495 395 890 90 0 100818 3: 490 330 820 90 0 100818 4: 495 460 955 96 0 100818 5: 495 370 865 91 0 100818 --- 1021: 470 400 870 61 0 100770 1022: 260 180 440 48 0 100770 1023: 345 190 535 39 0 100770 1024: 450 295 745 65 0 100770 1025: 395 230 625 79 0 100770 This data.table is named "analy" I want to scale the variables "LC","RC","TOEIC","eua". I can scale as below analy[,LC:=scale(LC)] analy[,RC:=scale(RC)] analy[,TOEIC:=scale(TOEIC)]

How to zoom in/out d3.time.scale without scaling other shapes bound to timeline

↘锁芯ラ 提交于 2019-12-07 09:00:57
问题 http://jsfiddle.net/HF57g/ is an example of a single event(blue rect) placed on the timeline. If i zoom into the timeline, rect's placement on the x axis changes in harmony with the ticks on axis. but at the same time, rect is scaled horizontally. if i modify the following section of the code svg.selectAll(".item").attr("transform", "translate(" + d3.event.translate[0]+", 0)scale(" + d3.event.scale+", 1)"); to svg.selectAll(".item").attr("transform", "translate(" + d3.event.translate[0]+", 0

scalesPageToFit not working properly running an iPhone app on iPad (iOS 7)

那年仲夏 提交于 2019-12-07 08:04:22
问题 UIWebview scalesPageToFit is not working properly when running an iPhone app on iPad with iOS 7 . I set the scalesPageToFit = YES before loading the request to the WebView. After the page loads, inspecting the HTML document width gives 769px while the UIWebView's scroll view frame width is 320. The scroll view zoomScale is 1 although you would expect it to be 0.41... (320/769). Any idea? 回答1: The problem is now fixed in iOS 7.0.3. But, if you can't go there, please read on. This seems to be a

Android ImageView setting Bitmap FitXY doesn't work

倖福魔咒の 提交于 2019-12-07 07:58:36
问题 I've been trying for a really long time to set the bitmap so it will fit the ImageView bounds. It just doesn't work via scaleType: fitXY . My bitmap images size are lower than the ImageView 's (Saved on 100X100 pixels), I want my bitmap images to fit and stretch into the ImageView . Here's some code: <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/imageView" android:layout_height="match_parent" android:layout_width="match_parent" android:src="@drawable

How to get zoom value of arbitrary matrix?

房东的猫 提交于 2019-12-07 05:53:49
问题 An image is scaled by a matrix: Matrix matrix = new Matrix(); matrix.postScale(...); matrix.postTranslate(...); matrix.postRotate(...); ... I hope the zoomed image won't be less than the half of original, so the total zoom should not less that 0.5. But how to do that? I tried to get the first value of matrix to check: float pendingZoom = 0.6f; float[] values = new float[9]; Matrix.getValues(values); float scalex = values[Matrix.MSCALE_X]; Then: if(scalex<0.5) { pendingZoom = pendingZoom * (0

How to scale glDrawPixels?

半腔热情 提交于 2019-12-07 05:25:34
问题 I need to scale the result of glDrawPixels image. I'm drawing a 640x480 pixels image buffer with glDrawPixels in a Qt QGLWidget. I tryed to do the following in PaintGL: glScalef(windowWidth/640, windowHeight/480, 0); glDrawPixels(640,480,GL_RGB,GL_UNSIGNED_BYTE,frame); But it doesn't work. I am setting the OpenGL viewport and glOrtho with the size of the widget as: void WdtRGB::paintGL() { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Setup the OpenGL viewpoint glMatrixMode(GL

d3.js: limit size of brush

家住魔仙堡 提交于 2019-12-07 03:35:57
问题 Is there a way to limit the size of a brush, even though the extent is larger? I put together a brush with only an x-scale that can be moved and resized. I would like to be able to limit the extent to which it can be resized by the user (basically only up to a certain point). In the following example, the brush function stops updating when the brush gets bigger than half the maximum extent. The brush itself, though, can still be extended. Is there a way to prevent this from happening? Or is

iPhone: I resize a contact's image, but when that person is calling, the picture isn't scaled to the screen size

有些话、适合烂在心里 提交于 2019-12-07 01:23:19
We have an app that resizes iPhone contact pictures and then saves them back in the address book. When Jim has a normal 1200 x 1600 picture, and he is calling my phone, the picture gets correctly scaled within the iPhone screen so that it shows the whole picture. When I resize this image to a 320 x 420-something, and save it in the address book, the picture no longer gets scaled, but gets 'blown up' so that I see the center of the picture. Is this someone has experienced before? Is it a coding error, or a bug in the iPhone? Thanks! Apparently this is a bug in the iPhone. A lot of users have