resize

How can I disable _moz_resizing?

荒凉一梦 提交于 2019-12-30 06:17:11
问题 I am using nicEdit editor and I have added my own custom image resizing script to it. But I want to disable the default _moz_resizing that appears in Firefox. I wanted to have finer control over the image being resized. ( Eg: Allow only the image to resize and inherit the width of the parent container. ) So I wrote a custom script. But since Firefox has its own image resizing control (_moz_resizing) how do I disable it? If there is no way to do so, I have a very simple workaround where I

Dropzone Resize Function

痴心易碎 提交于 2019-12-30 06:00:17
问题 I have implemented a dropzone page using http://www.dropzonejs.com/ I am having trouble with the resize functionality. My images are constantly cropped if they are of the wrong aspect ratio. I am wondering two things: Can i configure dropzone to fit (not stretch or crop) pics into the preview element. Can I resize the previews after they are dropped (ie view the previews small, medium or large. I have implemented 2 by adjusting the css, but im wondering if there is a better way using the

UIWebView and Animation

余生颓废 提交于 2019-12-30 05:02:27
问题 I am wondering if there was a way to animate the size and position of a UIWebView. If I do sth like this: [UIView animateWithDuration:1.0 animations:^{ self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0); }]; or [UIView beginAnimations:@"zoomIn" context:nil]; [UIView setAnimationDuration:2.75]; [UIView setAnimationDelegate: self]; self.frame = CGRectMake(20.0, 20.0, 80.0, 80.0); [UIView commitAnimations]; while there is a grey box doing the animation, the content of the WebView instantly switches

Qt: Resize borderless widget

六眼飞鱼酱① 提交于 2019-12-30 04:59:14
问题 My question is basically the same as this one, but applied to the Qt C++ framework. I am implementing a popup window by inheriting QWidget with flags Qt::QPopup | Qt::QWindow. I would like this window to be moveable and resizeable, I'm currently achieving this by using the mouse events in the following code: void TextPopup::mousePressEvent(QMouseEvent* event) { offset = event->pos(); QWidget::mousePressEvent(event); } void TextPopup::mouseMoveEvent(QMouseEvent* event) { if(event->buttons() &

C++: What is the proper way of resizing a dynamically allocated array?

别来无恙 提交于 2019-12-30 04:56:15
问题 In C, I would have done it using realloc . In C++, one would normally consider using the STL vector class. But how do I properly resize an array in C++ without using any of the above solutions? 回答1: There is no good equivalent of realloc in C++. You'll need to manually duplicate the array and copy the old elements over. Fortunately, thanks to the std::copy function in <algorithm> , this isn't too bad: size_t k = /* ... */ T* buffer = /* .. get old buffer of size k. .. */ T* newBuffer = new T

WPF Window with Style=None cover taskbar when Maximised after app initialization

那年仲夏 提交于 2019-12-30 02:43:07
问题 I want to achieve the same effect as Windows Media Player or Browser based Flash players which take up the ENTIRE (not even the taskbar is visible) real estate when maximized. This works fine if the WindowState is set to Maximized and the WindowStyle is set to None in XAML so the app is started in that state. Problem is I want to start the app in a bordered window and when the user chooses, maximize as specified above. In the StateChanged handler I check for Maximized state and if this is the

Views inside a custom ViewGroup not rendering after a size change

时光怂恿深爱的人放手 提交于 2019-12-30 00:28:28
问题 I'm running into a problem that has me stumped and I was hoping someone could give me some pointers. I'm working on an application that uses a custom ViewGroup (actually a FrameLayout that contains a RelativeLayout) to render an event calendar. The events inside the calendar are represented as views that are sized according to the duration of the event and the size of the containing view. I'm running into a problem that occurs when the containing FrameLayout is resized. The current

WPF Resize UserControl with aspect ratio

房东的猫 提交于 2019-12-29 09:11:01
问题 I have a UserControl and that UserControl has to be resized with aspect ratio. That means: width:height = 2:1. Currently I am using this code: protected override Size ArrangeOverride(Size arrangeBounds) { if (ActualWidth == 0 || ActualHeight == 0) return arrangeBounds; base.ArrangeOverride(arrangeBounds); double ratio = 2; if (Parent != null) { var size = new Size(arrangeBounds.Height * ratio, arrangeBounds.Height); double containerWidth = ((FrameworkElement)Parent).ActualWidth; if

How to batch resize millions of images to fit a max width and height?

删除回忆录丶 提交于 2019-12-29 06:26:12
问题 The situation I'm looking for a way to batch-resize approximately 15 million images of different file types to fit a certain bounding box resolution (in this case the image(s) cannot be bigger than 1024*1024), without distorting the image and thus retaining the correct aspect ratio. All files are currently located on a Linux server on which I have sudo access, so if I need to install anything, I'm good to go. Things I've tried After dabbling around with some tools under Windows (Adobe

Image resizing algorithm

一世执手 提交于 2019-12-29 04:44:10
问题 I want to write a function to downsize an image to fit specified bounds. For example i want to resize a 2000x2333 image to fit into 1280x800. The aspect ratio must be maintained. I've come up with the following algorithm: NSSize mysize = [self pixelSize]; // just to get the size of the original image int neww, newh = 0; float thumbratio = width / height; // width and height are maximum thumbnail's bounds float imgratio = mysize.width / mysize.height; if (imgratio > thumbratio) { float scale =