resize

Load image without autoscaling in Android

Deadly 提交于 2020-01-04 13:12:03
问题 I'm trying to create a map for a game through an image, where each black pixel is equivalent to a wall, and yellow to flowers(1) and green grass(0) so far i had this image (50x50): http://i.imgur.com/Ydj9Cp2.png the problem here seems to be that, when i read the image on my code, it get's scaled up to 100x100, even tough i have it on the raw folder. I can't let it scale up or down because that will put noise and blur on the image and then the map won't be readable. here i have my code: (...)

Resize div along with content inside according to window size

与世无争的帅哥 提交于 2020-01-04 05:46:08
问题 I have looked up a million techniques and I can't get this to work and I know there is other posts similar to this. I'm sorry if it bugs anyone but I need specific instructions for my code cuz me stupid. Thank you so much in advance! I want the div container contentContactBox, along with all of the divs inside it, to proportionally resize when the browser window is resized. On the left side of the contentcontactBox is some text and on the right is a google map imbed. I want them all to shrink

How to proportionally size images to fit dimensions of 200px x 150px thumbnail in css?

拟墨画扇 提交于 2020-01-04 05:27:17
问题 I`ve tried a couple of things even using the CSS clip, but not getting it proportionally fit in the thumbnails here http://giantmango.com/arttest2-2510. In CSS, what is the best way and how would I proportionally resize an image to display in dimensions of a 200px (width) x 150 (height) thumbnail? Just checked firebug and for some reason all my img tags are always set to a height of 200 even though I have max-height set to 150... 回答1: Use max-height and max-width. Beware that they are broken

SVG lengthAdjust only for shrinking but not for stretching

拥有回忆 提交于 2020-01-04 05:18:48
问题 Is there a nice and easy way to to have the functionality of lengthAdjust (together with textLength) for shrinking text if necessary (if too wide) but never attempting to stretch it? Two possible solutions for a SVG generated through JS come to my mind: Count characters (or rather grapheme clusters ) and based on that (together with some heuristics unless a fixed-width size font is used) determine whether to set textLength or not. First do it without textLength set and then determine using

C# Creating thumbnail (low quality and big size problem)

 ̄綄美尐妖づ 提交于 2020-01-04 05:08:20
问题 public void CreateThumbnail(Image img1, Photo photo, string targetDirectoryThumbs) { int newWidth = 700; int newHeight = 700; double ratio = 0; if (img1.Width > img1.Height) { ratio = img1.Width / (double)img1.Height; newHeight = (int)(newHeight / ratio); } else { ratio = img1.Height / (double)img1.Width; newWidth = (int)(newWidth / ratio); } Image bmp1 = img1.GetThumbnailImage(newWidth, newHeight, null, IntPtr.Zero); bmp1.Save(targetDirectoryThumbs + photo.PhotoID + ".jpg"); img1.Dispose();

Resize images and setCompoundDrawablesWithIntrinsicBounds

╄→гoц情女王★ 提交于 2020-01-03 18:51:28
问题 My app contains buttons with images on them, set by using setCompoundDrawablesWithIntrinsicBounds . I use images from the app's drawables folder, but also use images downloaded from the web and stored on SD card. I found that I needed to upscale the SD card images so they'd render as the same size as the images in drawables . I did this using: Options opts = new BitmapFactory.Options(); opts.inDensity = 160; Bitmap bm = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() +

CSS3 resize property allows only increasing DIV size

蹲街弑〆低调 提交于 2020-01-03 15:31:07
问题 There is a resize property in CSS3 which can be applied to a div (e.g. http://www.impressivewebs.com/css3-resize/). I am building a rich UI, and found this feature very useful in my case. I try to rely on CSS3 more than JavaScript, so I like this "native" solution. This problem is - it doesn't allow a user to make the box less than its original size. It reproduces in Safari 5.0.5, Chrome 12.0.742.91, while Firefox 4.0.1 resizes a box in both ways. Question : is there any workaround for

ResizeEnd event is not triggered when resizing the form by maximize button?

◇◆丶佛笑我妖孽 提交于 2020-01-03 14:17:44
问题 In my application the ResizeEnd event is triggered when resizing the form by dragging the corners, but it will not be triggered when I click the maximize button. The Resize event does not work in my scenario so I need to use ResizeEnd event. Why is this event not triggered while resizing the form by maximize button? Or can anyone suggest alternatives? 回答1: The ResizeEnd event is raised when the user finishes resizing a form, typically by dragging one of the borders or the sizing grip located

ResizeEnd event is not triggered when resizing the form by maximize button?

◇◆丶佛笑我妖孽 提交于 2020-01-03 14:16:08
问题 In my application the ResizeEnd event is triggered when resizing the form by dragging the corners, but it will not be triggered when I click the maximize button. The Resize event does not work in my scenario so I need to use ResizeEnd event. Why is this event not triggered while resizing the form by maximize button? Or can anyone suggest alternatives? 回答1: The ResizeEnd event is raised when the user finishes resizing a form, typically by dragging one of the borders or the sizing grip located

php imagick gif resize all frame

六月ゝ 毕业季﹏ 提交于 2020-01-03 04:40:34
问题 i have a problem to resize all frame using php imagick. it's take from official php doc example http://ir.php.net/manual/en/imagick.examples-1.php /* Create a new imagick object and read in GIF */ $im = new Imagick("/tmp/bbb.gif"); /* Resize all frames */ foreach ($im as $frame) { /* 50x50 frames */ $frame->thumbnailImage(50, 50); /* Set the virtual canvas to correct size */ $frame->setImagePage(50, 50, 0, 0); } /* Notice writeImages instead of writeImage */ $im->writeImages("/tmp/zb.gif",