crop

Are there any good examples of how to take a screenshot in selenium webdriver C#, then crop and save the image?

混江龙づ霸主 提交于 2019-12-04 18:31:10
I've been searching for some good examples of how to take a screenshot using ITakesScreenshot in Selenium Webdriver in C#, then to crop the image using the elements dimensions and then saving this new image. With no such luck have I found any in C#. I have this method at the moment but every so often I get a Out of Memory exception when used in a test. It fails on the line where it tries to crop. public void TakeScreenShotOfElement(IWebDriver _driver, string rootpath, string imgName, string element2) { string element3 = element2; var element = driver.FindElement(By.XPath(element3)); Byte[] ba

Typo3 Fluid Image crop of with and height failure

て烟熏妆下的殇ゞ 提交于 2019-12-04 18:23:15
Using this code: <f:image src="/uploads/extkey/{image}" alt="" width="115c" height="70c" /> Produces following HTML output: <img src="typo3temp/_processed_/csm_testimage_31f6051846.gif" width="115" height="92" alt=""> The image has a wrong height now and there are white bars at top and bottom. I figured out that "92" comes from its proportion (original image is: 1280 × 1024). I guess if the white bars at top and bottom are cut out the height of 70 will be reached. Any ideas why Typo3 is doing that wrong and does some others here having the same problem? Using Typo3 6.1.5 ImageMagick 6 EDIT #2:

Crop image white space in C#

血红的双手。 提交于 2019-12-04 16:24:58
I have the request that crop image white space in C#, and I search some methods from the forum, but it could not satisfy my request. There is the original image, This is the result I expect, Any help are appreciate. Ailis You can try to get first image data(There is an image), and draw the data into a new image. Try this method. Hope it can help you. private static Bitmap ImageTrim(Bitmap img) { //get image data BitmapData bd= img.LockBits(new Rectangle(Point.Empty, img.Size), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); int[] rgbValues = new int[img.Height * img.Width]; Marshal.Copy

Objective-C iOS Crop Image Using Zoom?

﹥>﹥吖頭↗ 提交于 2019-12-04 14:25:37
问题 I am trying to use this code to allow users to zoom and crop their images in my app: https://github.com/iosdeveloper/ImageCropper/tree/master/Classes/ImageCropper code snippet float zoomScale = 1.0 / [scrollView zoomScale]; CGRect rect; rect.origin.x = [scrollView contentOffset].x * zoomScale; rect.origin.y = [scrollView contentOffset].y * zoomScale; rect.size.width = [scrollView bounds].size.width * zoomScale; rect.size.height = [scrollView bounds].size.height * zoomScale; CGImageRef cr =

Crop Image using Canvas Rectangle

拜拜、爱过 提交于 2019-12-04 14:24:37
问题 Cropping the image is not working properly. Where I'm wrong? My Xaml : <Grid x:Name="Gridimage1"> <Image Name="image1" Grid.Column="0" Height="317" HorizontalAlignment="Left" Margin="20,67,0,0" Stretch="Fill" VerticalAlignment="Top" Width="331"></Image> <Canvas x:Name="BackPanel"> <Rectangle x:Name="selectionRectangle" Stroke="LightBlue" Fill="#220000FF" Visibility="Collapsed" /> </Canvas> </Grid> <Button Content=">>" Height="23" HorizontalAlignment="Left" Margin="357,201,0,0" Name="Go"

Change size of rectangle by dragging its corners in Android?

杀马特。学长 韩版系。学妹 提交于 2019-12-04 14:10:25
http://farm3.anhso.net/upload/20110221/12/o/anhso-121531_example.jpg Here is the examples, when you drag A or B , the size of rectangle will be changed How can i do it? Its fairly simple. Let me assume that there is only a single view in your layout. This makes a few things a lot easier. When you receive a touch down action, you must check where on the view this point lies. the coordinates of the rectangle are obviously known to you. Also understand that you need to touch in the vicinity of A or B. Touch is only "intended" to be precise. But in actuality its not. So you must create a vicinity

iOS : Crop video weird green line left and bottom side in video

做~自己de王妃 提交于 2019-12-04 14:07:00
问题 -How to remove green line on the video. when crop a video 2 or 3 times at that time show green or mix green-red blink line in the video, left or bottom or both left and bottom side in the video. video crop method. -(void)cropButton { CGRect cropFrame = self.cropView.croppedImageFrame; //load our movie Asset AVAsset *asset; asset = [AVAsset assetWithURL:[NSURL fileURLWithPath:[self.videoDataArr objectAtIndex:self.selectedIndex-1]]]; //create an avassetrack with our asset AVAssetTrack

OpenCV cvRemap Cropping Image

ε祈祈猫儿з 提交于 2019-12-04 13:35:19
问题 So I am very new to OpenCV (2.1), so please keep that in mind. So I managed to calibrate my cheap web camera that I am using (with a wide angle attachment), using the checkerboard calibration method to produce the intrinsic and distortion coefficients. I then have no trouble feeding these values back in and producing image maps, which I then apply to a video feed to correct the incoming images. I run into an issue however. I know when it is warping/correcting the image, it creates several

Cropping an image in Java [closed]

℡╲_俬逩灬. 提交于 2019-12-04 12:47:41
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 5 years ago . I'm trying to cut a certain part of image in Java and save it back to disk. Is there a function that cuts the images from X, Y with the specified width and height? You'd typically Create a new BufferedImage ( dst below) with the desired width and height. Get hold of it's Graphics object Load the original .jpeg image ( src below) Paint the desired part of that, onto

Upload, resize, and crop center of image with PHP

感情迁移 提交于 2019-12-04 12:04:22
I'm wanting to create a very very basic upload, resize, and crop PHP script. The functionality to this will be identical (last i checked anyway) to the method Twitter uses to upload avatar pictures. I want the script to take any size image, resize the shortest side to 116px, then crop off the top and bottom (or left and right side if it's landscape) as to get a square 116px by 116px. I don't want a bloated PHP script with client side resizing or anything, just a simple PHP resize and crop. How is this done? The GD Library is a good place to start. http://www.php.net/manual/en/book.image.php