[Solved] Android force close when using setBackgroundColor and setImageDrawable in loop [closed]

You need to create imageview dynamically. ImageView images[]; View shelfRow[] =new View[numberOfRows]; for (int i = 0; i < numberOfRows; i++) { images = new ImageView[numberOfRows]; shelfRow[i].setBackgroundResource(R.drawable.shelf_row2); images[i].setBackgroundColor(android.R.color.black); parentPanel.addView(shelfRow[i]); } Or create 10 imageviews and give id to it like.. int[] buttonIDs = new int[] {R.id.button1ID, R.id.button2ID, R.id.button3ID, … }; View shelfRow[] =new View[numberOfRows]; ImageView[] … Read more

[Solved] Error on findViewById – Subsampling Scale Image View – Android [closed]

Quick solution: Replace id.imageView with R.id.imageView. What happens is, when you want to reference an ID, you go to the R (Resources) directory provided by android. You have to go to the resources directory (R), and then in there there’s the id directory. Then there’s your id. So, the final result is R.id.imageView. 2 solved … Read more

[Solved] How can I create a star based feedback system for a website?

You could try something like this: In your HTML page, pass arrays containing strings to the Javascript change() function based on which stars should be changed. For example: <img src=”https://stackoverflow.com/questions/28414185/star.png” width=”20px” height=”20px” id=”1″ onclick=”change([‘1’]);”> <img src=”https://stackoverflow.com/questions/28414185/star.png” width=”20px” height=”20px” id=”2″ onclick=”change([‘1’, ‘2’]);”> <img src=”https://stackoverflow.com/questions/28414185/star.png” width=”20px” height=”20px” id=”3″ onclick=”change([‘1’, ‘2’, ‘3’]);”> <img src=”https://stackoverflow.com/questions/28414185/star.png” width=”20px” height=”20px” id=”4″ onclick=”change([‘1’, … Read more

[Solved] Create a custom gauge with an image Objective C [closed]

One of the many solutions, given the fuzziness of the question, is to use Core Animation. The official Apple documentation is here. Let’s outline three steps: Conceptual step Define what layers (conceptually) or masks you will use, and create the images that will be imported in them Definition step Define your CABasicAnimation and program the … Read more

[Solved] downloaded Image creating problem in html [closed]

Location of your image matters a lot. The image should be in website folder. Have you created a folder like “images” in your website directory? If not, then please do this change and secondly, after doing the above thing, the url of the image in the code should be like “/images/image-name.jpg”. change extension according to … Read more

[Solved] How to provide dynamic HTML in PHP?

You could use include and ob_get_contents to get the html as string and do some str_replace or preg_replace on that. Your HTML: <html> <body> <img src=”https://stackoverflow.com/questions/10533622/{IMAGE_SRC}” width=”512″ height=”512″ name=”image” /> </body> </html> Your PHP: ob_start(); include ‘your_file.html’; $buffer = ob_get_contents(); ob_end_clean(); $buffer = str_replace(“https://stackoverflow.com/questions/10533622/{IMAGE_SRC}”, ‘your_image.png’, $buffer); print $buffer; 1 solved How to provide dynamic HTML … Read more

[Solved] CSS Image Effects

There are several way to create this, one is to use 2 images, one by default another on hover from css, the text can stand inside the div holding the image. If it is not responsive, it will look something like this: .image{ position: relative; height: 300px; width: 300px; } .image:after{ position: absolute; z-index: 1; … Read more

[Solved] How can I access each pixel in OpenCV, perform an operation and return the new information to the image?

I think that this code you could use int nl= image.rows; int nc= image.cols * image.channels(); for (int j=0; j<nl; j++) { uchar* data= image.ptr<uchar>(j); for (int i=0; i<nc; i++) { data[i]= data[i]/div*div + div/2; } } solved How can I access each pixel in OpenCV, perform an operation and return the new information to … Read more

[Solved] Blur effect on background

From https://stackoverflow.com/a/36193733: I recently came across Renderscript API. //Set the radius of the Blur. Supported range 0 < radius <= 25 private static final float BLUR_RADIUS = 25f; public Bitmap blur(Bitmap image) { if (null == image) return null; Bitmap outputBitmap = Bitmap.createBitmap(image); final RenderScript renderScript = RenderScript.create(this); Allocation tmpIn = Allocation.createFromBitmap(renderScript, image); Allocation tmpOut … Read more

[Solved] Changing Beginning of img [closed]

I’m not entirely sure what you’re asking, but it sounds like you might want to do CSS sprites. http://css-tricks.com/css-sprites/ If you want to change the image on click, you’ll need some code. I won’t spend too much time on that, given your question is hard to decipher, but if it were me, I would create … Read more