scaling

Overlaying 2D paths on UIImage without scaling artifacts

被刻印的时光 ゝ 提交于 2020-01-06 05:18:17
问题 I need to draw a path along the shape of an image in a way that it is always matching its position on the image independent of the image scale. Think of this like the hybrid view of Google Maps where streets names and roads are superimposed on top of the aerial pictures. Furthermore, this path will be drawn by the user's finger movements and I need to be able to retrieve the path keypoints on the image pixel coordinates. The user zooms-in in order to more precisely set the paths location. I

calculate mp3 average volume

好久不见. 提交于 2020-01-05 12:16:47
问题 I need to know the average volume of an mp3 file so that when I convert it to mp3 (at a different bitrate) I can scale the volume too, to normalize it... Therefore I need a command line tool / ruby library that gives me the average volume in dB. 回答1: You can use sox (an open source command line audio tool http://sox.sourceforge.net/sox.html) to normalize and transcode your files at the same time. EDIT Looks like it doesn't have options for bit-rate. Anyway, sox is probably overkill if LAME

How to scale UIImageView properly with UIView animateWithDuration?

◇◆丶佛笑我妖孽 提交于 2020-01-04 11:12:26
问题 I'm scaling UIImageView and then reverting it using UIView animateWithDuration with UIViewAnimationOptionAutoreverse option. The problem is the image animation is a little bit jaggy (twitching) at the end of the animation. Here's my code: [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionAutoreverse animations:^{ myImage.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);} completion:^(BOOL finished){if (finished){ myImage.transform =

How to scale UIImageView properly with UIView animateWithDuration?

↘锁芯ラ 提交于 2020-01-04 11:12:14
问题 I'm scaling UIImageView and then reverting it using UIView animateWithDuration with UIViewAnimationOptionAutoreverse option. The problem is the image animation is a little bit jaggy (twitching) at the end of the animation. Here's my code: [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionAutoreverse animations:^{ myImage.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);} completion:^(BOOL finished){if (finished){ myImage.transform =

How to scale UIImageView properly with UIView animateWithDuration?

我们两清 提交于 2020-01-04 11:12:02
问题 I'm scaling UIImageView and then reverting it using UIView animateWithDuration with UIViewAnimationOptionAutoreverse option. The problem is the image animation is a little bit jaggy (twitching) at the end of the animation. Here's my code: [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionAutoreverse animations:^{ myImage.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.9, 0.9);} completion:^(BOOL finished){if (finished){ myImage.transform =

WPF version of .ScaleControl?

我的梦境 提交于 2020-01-04 06:01:22
问题 What is the WPF version of Control.ScaleControl? i am trying to honor the user's font preference by setting the font to the IconTitleFont: private void ApplyUserFontPreferences() { this.FontFamily = SystemFonts.IconFontFamily; this.FontSize = SystemFonts.IconFontSize; this.FontStyle = SystemFonts.IconFontStyle; this.FontWeight = SystemFonts.IconFontWeight; } Unlike WinForms, the contents of the form are not scaled with the font change: Before After (bad) In reality all controls on the form

How to disable anti-aliasing when scaling up an imageview in android?

会有一股神秘感。 提交于 2020-01-04 05:11:07
问题 I have a pixel art that I want to scale up. The problem is when I scale it up, it gets all blurred cause of the antialiasing. Is there a way to disable antialiasing directly from xml? 回答1: i hope its useful Bitmap bmpSource = BitmapFactory.decodeResource(getResources(), SourceFileId); //100 is dimension to resizing image size //Passing filter = false will result in a blocky, pixellated image. //Passing filter = true will give you smoother edges Bitmap bmpScaled = Bitmap.createScaledBitmap

Java image scaling improve quality?

杀马特。学长 韩版系。学妹 提交于 2020-01-04 02:06:10
问题 I am currently scaling images using the following code. Image scaledImage = img.getScaledInstance( width, int height, Image.SCALE_SMOOTH); BufferedImage imageBuff = new BufferedImage(width, scaledImage.getHeight(null), BufferedImage.TYPE_INT_RGB); Graphics g = imageBuff.createGraphics(); g.drawImage(scaledImage, 0, 0, new Color(0, 0, 0), null); g.dispose(); ImageIO.write(imageBuff, "jpg", newFile); Anyone have an idea of a better way of scaling an image and getting better quality results, or

Render large CATiledLayer into smaller area

别等时光非礼了梦想. 提交于 2020-01-02 23:04:24
问题 I have a CATiledLayer of size 4096 x 4096 which I want to render into a PNG of size 1024 x 1024 this isnt doing it... -(NSData *)createPNGFormat { UIGraphicsBeginImageContext(CGSizeMake(1024, 1024)); tiledLayer.transform = CATransform3DMakeScale(0.25, 0.25, 1.0); [tiledLayer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return UIImagePNGRepresentation(image); } Any ideas on how to do this? 回答1: [First

Bilinear interpolation

我与影子孤独终老i 提交于 2020-01-02 07:51:44
问题 I got this code for scaling image by bilinear interpolation.I know this works but i can't figure out one thing what if the approximated pixel value is an edge(by edge i mean it is in the last row or last column) pixel in the input image then i can i gt a pixel of coordinate (x+1,y+1) ,this should lead to a array index out of range error but no such error occurs why? The code is: public int[] resizeBilinearGray(int[] pixels, int w, int h, int w2, int h2) { int[] temp = new int[w2*h2] ; int A,