image-scaling

App size is too big because of too many images

落爺英雄遲暮 提交于 2019-12-03 17:00:03
I'm creating an universal app. For one screen, I'm displaying 6 images (png format) in a grid using this control. Also this screen supports both portrait and landscape orientation. I've created a set of images in different resolutions for all the iDevices and named them using the correct naming convention as follows. name~iphone.png name@2x~iphone.png name~ipad.png name@2x~ipad.png name-568h@2x~iphone.png (iPhone 5) And I had to create another set of these images since I support both orientation and I can't use the same images as above because in landscape it would stretch. Now I have close to

How to fix pinch zoom focal point in a custom view?

旧时模样 提交于 2019-12-03 12:46:30
For my question I have prepared a very simple test app at Github. For simplicity I have removed flinging, scroll constraints and edge effects (which actually work well in my real app): So the custom view in my test app only supports scrolling: mGestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float dX, float dY) { mBoardScrollX -= dX; mBoardScrollY -= dY; ViewCompat.postInvalidateOnAnimation(MyView.this); return true; } }); and pinch zooming with 2 fingers (the focus is broken though

Resize images in directory

我的未来我决定 提交于 2019-12-03 07:50:45
问题 I have a directory full of images that I would like to resize to around 60% of their original size. How would I go about doing this? Can be in either Python or Perl Cheers Eef 回答1: How about using mogrify, part of ImageMagick? If you really need to control this from Perl, then you could use Image::Magick, Image::Resize or Imager. 回答2: If you want to do it programatically, which I assume is the case, use PIL to resize e.g. newIm = im.resize((newW, newH) then save it to same file or a new

Animatedly reduce button size on press and regain it's size on release

偶尔善良 提交于 2019-12-03 05:20:08
问题 I want a to create a button that changes size (little bit smaller) when it's pressed, and after the button is released again the size should change back to normal size.I am using Scale xml to achieve this but it re-positioned itself even if i do not release button. button here i am referring to imageview. here is my source code :- imgSpin = (ImageView) findViewById(R.id.iv_spins); imgSpin.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent

image Scaling of picture box

 ̄綄美尐妖づ 提交于 2019-12-03 04:51:53
问题 i got a problem with image scaling in C#. I have a picture Box with given Size : e.g. width = 800px height = 600px I am loading different images into that picture box, small ones ( 400x400) and big ones (800+ x 600+) My images are getting resized if they do not fit into box. But they are always resized to MAX width and height of PictureBox. So the aspect ratio is destroyed . Can anybody help to identify / fix the problem? Classes: Form1.cs ImageHandling.cs (commented out) ImageUtilities.cs

How do I do high quality scaling of a image?

末鹿安然 提交于 2019-12-03 02:03:29
问题 I'm writing some code to scale a 32 bit RGBA image in C/C++. I have written a few attempts that have been somewhat successful, but they're slow and most importantly the quality of the sized image is not acceptable. I compared the same image scaled by OpenGL (i.e. my video card) and my routine and it's miles apart in quality. I've Google Code Searched, scoured source trees of anything I thought would shed some light (SDL, Allegro, wxWidgets, CxImage, GD, ImageMagick, etc.) but usually their

Resize images in directory

和自甴很熟 提交于 2019-12-02 21:19:26
I have a directory full of images that I would like to resize to around 60% of their original size. How would I go about doing this? Can be in either Python or Perl Cheers Eef How about using mogrify, part of ImageMagick ? If you really need to control this from Perl, then you could use Image::Magick , Image::Resize or Imager . Anurag Uniyal If you want to do it programatically, which I assume is the case, use PIL to resize e.g. newIm = im.resize((newW, newH) then save it to same file or a new location. Go through the folder recursively and apply resize function to all images. I have come up

image Scaling of picture box

ⅰ亾dé卋堺 提交于 2019-12-02 18:06:34
i got a problem with image scaling in C#. I have a picture Box with given Size : e.g. width = 800px height = 600px I am loading different images into that picture box, small ones ( 400x400) and big ones (800+ x 600+) My images are getting resized if they do not fit into box. But they are always resized to MAX width and height of PictureBox. So the aspect ratio is destroyed . Can anybody help to identify / fix the problem? Classes: Form1.cs ImageHandling.cs (commented out) ImageUtilities.cs Examples: Problem 1: My Version vs Original Source Problem 2: My Version vs Original Source How i want it

Resize transparent images using C#

那年仲夏 提交于 2019-12-02 14:10:47
Does anyone have the secret formula to resizing transparent images (mainly GIFs) without ANY quality loss - what so ever? I've tried a bunch of stuff, the closest I get is not good enough. Take a look at my main image: http://www.thewallcompany.dk/test/main.gif And then the scaled image: http://www.thewallcompany.dk/test/ScaledImage.gif //Internal resize for indexed colored images void IndexedRezise(int xSize, int ySize) { BitmapData sourceData; BitmapData targetData; AdjustSizes(ref xSize, ref ySize); scaledBitmap = new Bitmap(xSize, ySize, bitmap.PixelFormat); scaledBitmap.Palette = bitmap

How to make the image scale its size automatically according to the parent JLabel's size, in Netbeans GUI Builder?

那年仲夏 提交于 2019-12-02 01:38:31
BACKGROUND:- I am required to make a Swing GUI using Netbeans GUI Builder. The first sub-task is to display an image in the entire background. I have followed a tutorial to get that done. I have basically made a JFrame, set its layout to GridBagLayout and then added a transparent (by unchecking the opaque property) JPanel to it. (Question 1) After that I added a JLabel to the JFrame, Removed its text and added an image to it. (Question 2) QUESTIONS:- First, when I add the JPanel, it does not show its resize handles. I Googled a bit and found this tutorial , in which it can be seen that when