android - Resizing a view to its Contents -



android - Resizing a view to its Contents -

i have custom view class draw bitmap view

protected void onsizechanged(int w, int h, int oldw, int oldh) { super.onsizechanged(w, h, oldw, oldh); log.d("log","called w , h " + w +"," + h); // method called multiple times initialized 1 time if (wheelheight == 0 || wheelwidth == 0) { wheelheight = h; wheelwidth = w; // resize image matrix resize = new matrix(); resize.postscale((float)0.60, (float)0.60); imagescaled = bitmap.createbitmap(imageoriginal, 0, 0, imageoriginal.getwidth(), imageoriginal.getheight(), resize, false); // translate matrix image view's center float translatex = wheelwidth / 2 - imagescaled.getwidth() / 2; float translatey = wheelheight / 2 - imagescaled.getheight() / 2; matrix.posttranslate(translatex, translatey); wheelmenu.this.setimagebitmap(imagescaled); wheelmenu.this.setimagematrix(matrix); //this has no affeect on height of view setminimumheight(imagescaled.getheight()); log.d("image","the height of command is" +getheight()); log.d("image","the height of bitmap is" +imagescaled.getheight()); } }

what trying alter height of view heigh of bitmap. setting height has not impact on view. doing wrong ?

kind regards

android

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -