tiling

Tiling images in android with ImageView in XML

送分小仙女□ 提交于 2019-11-30 03:51:31
问题 I am trying to get an image on the background to tile until the background is full. My current code is: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/cartoonclouds" android:contentDescription="@string/desc" android:tileMode="repeat" /> <LinearLayout

very large image manipulation and tiling

亡梦爱人 提交于 2019-11-29 16:46:42
I need a software or program in Java or a method for tiling very large images (bigger than 140MB). I have used ImageMagick and convert tools Photoshop and Corel Draw and Matlab (in Windows), but I have a problem with memory overload. ImageMagick is very slow and result is not desirable. I don't know how can I only load a small part of image to memory without loading the whole image from harddisk. If you use native code, libraries such as libjeg give you scanline access to to images - you'd at most need to load 16 scanlines at a time. BryanD You should take a look at the Java Advanced Imaging

Tiling a Bitmap on a Canvas

寵の児 提交于 2019-11-29 12:43:07
问题 I would like to create a 'graph paper' look to the Bitmap I am drawing via a Canvas, and trying to figure out the best way to do this. I can't pass a source Bitmap containing the graph paper background to the Canvas constructor, as I am getting the Canvas in a SurfaceView via the .lockCanvas() call. Some solutions I've tried: I've tried implementing this solution in my SurfaceView's Thread.run(), but the issue I believe is when the BitmapDrawable is converted to a Bitmap... it loses the

Generalizing the algorithm for domino tiling?

老子叫甜甜 提交于 2019-11-28 20:22:43
In this earlier question the OP asked the following problem: Given a rectangular grid where some squares are empty and some are filled, what is the largest number of 2x1 dominoes that can be placed into the world such that no two dominos overlap and no domino is atop a filled square? The (quite beautiful!) answer to this problem recognized that this is equivalent to finding a maximum bipartite matching in a specially-constructed graph. In this graph, each empty square has a node that is linked to each of its neighbors by an edge. Each domino then corresponds to an edge in the graph such that

How do I convert a 2X2 matrix to 4X4 matrix in MATLAB?

北战南征 提交于 2019-11-27 15:46:45
I need some help in converting a 2X2 matrix to a 4X4 matrix in the following manner: A = [2 6; 8 4] should become: B = [2 2 6 6; 2 2 6 6; 8 8 4 4; 8 8 4 4] How would I do this? A = [2 6; 8 4]; % arbitrary 2x2 input matrix B = repmat(A,2,2); % replicates rows & columns but not in the way you want B = B([1 3 2 4], :); % swaps rows 2 and 3 B = B(:, [1 3 2 4]); % swaps columns 2 and 3, and you're done! In newer versions of MATLAB (R2015a and later) the easiest way to do this is using the repelem function: B = repelem(A, 2, 2); For older versions, a short alternative to the other (largely) indexing

Tiled drawable sometimes stretches

倖福魔咒の 提交于 2019-11-27 03:12:00
I have a ListView whose items have a tiled background. To accomplish this, I use the following drawable xml: <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/tile" android:tileMode="repeat" /> Usually, this works. Sometimes, however, the src drawable isn't tiled, but stretched to fill the entire list item. (I've got several different tiles like this, and I use them mixed in one ListView. If there is stretching instead of tiling, it's never been in all of them at once, for what that's worth.) I also tried to add android:dither="true" to that xml, since I

Matlab - building a matrix by merging the same raw vector multiple times

橙三吉。 提交于 2019-11-26 23:16:17
问题 Is there a matlab function which allows me to do the following operation? x = [1 2 2 3]; and then based on x I want to build the matrix m = [1 2 2 3; 1 2 2 3; 1 2 2 3; 1 2 2 3] 回答1: You are looking for the REPMAT function: x = [1 2 2 3]; m = repmat(x,4,1); You can also use indexing to repeat the rows: m = x(ones(4,1),:); or even outer-product: m = ones(4,1)*x; and also using BSXFUN: m = bsxfun(@times, x, ones(4,1)) 回答2: You could try using vertcat , like this: x = [1 2 2 3]; m = vertcat(x,x,x

Tiled drawable sometimes stretches

走远了吗. 提交于 2019-11-26 10:24:58
问题 I have a ListView whose items have a tiled background. To accomplish this, I use the following drawable xml: <bitmap xmlns:android=\"http://schemas.android.com/apk/res/android\" android:src=\"@drawable/tile\" android:tileMode=\"repeat\" /> Usually, this works. Sometimes, however, the src drawable isn\'t tiled, but stretched to fill the entire list item. (I\'ve got several different tiles like this, and I use them mixed in one ListView. If there is stretching instead of tiling, it\'s never