w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Binding objective-c library to Xamarin Project using Objective Sharpie
If Objective-Sharpie doesn't work for your project, you can: Do a manual binding, or build upon David Sandor's one. That's not that hard. Try to find the offending part of the header file, by removing part of it and process it with Obj-Sharpie (the header file is not that long, once you strip the comments away)

Categories : Objective C

Translate objective-c into ruby
You'll have to work out the Ruby side of things yourself, but this line of code: [self presentSemiViewController:semiVC withOptions:@{ KNSemiModalOptionKeys.pushParentBack : @(YES), KNSemiModalOptionKeys.animationDuration : @(0.3), KNSemiModalOptionKeys.shadowOpacity : @(0.8), }]; Is the same as this: NSDictionary *dict = [NSDictionary, dictionaryWithObjectsAndKeys: [NSNumber numberWithBOOL:YES], KNSemiModalOptionKeys.pushParentBack, [NSNumber numberWithFloat:0.3], KNSemiModalOptionKeys.animationDuration, [NSNumber numberWithFloat:08], KNSemiModalOptionKeys.shadowOpacity]; [self presentSemiViewController:semiVC withOptions:dict]; Assuming that KNSemiModalOptionKeys.pushParentBack is using dot notation to execute a method, each of those could be

Categories : Objective C

google translate in Objective-C
No. All API's I've used have always been either JSON or XML. There is no reason to use string manipulation when you can just parse the data into a readable structure If you are looking to use another service that isn't paid, keep in mind there are normally strict limitations. Try something like: SDL https://www.beglobal.com/developers/api-documentation/ Have you read Google's Translate API Documentation? https://developers.google.com/translate/ For example performing a GET request like so GET https://www.googleapis.com/language/translate/v2?key=INSERT-YOUR-KEY&source=en&target=de&q=Hello%20world Should return the following response: { "data": { "translations": [ { "translatedText": "Hallo Welt" } ] } } Wi

Categories : Objective C

Xamarin - Objective Sharpie - Error
Before using the Objective Sharpie, The command line tools need to be installed in Xcode -> Preferences -> Downloads pane. This solved the error/issue am facing. Perhaps this answer helped me.

Categories : IOS

I am using CIFilter to get a blur image,but why is the output image always larger than input image?
This is a super late answer to your question, but the main problem is you're thinking of a CIImage as an image. It is not, it is a "recipe" for an image. So, when you apply the blur filter to it, Core Image calculates that to show every last pixel of your blur you would need a larger canvas. That estimated size to draw the entire image is called the "extent". In essence, every pixel is getting "fatter", which means that the final extent will be bigger than the original canvas. It is up to you to determine which part of the extent is useful to your drawing routine.

Categories : IOS

Xamarin binding objective-c library to C# delegates and events
Now, the minute I post a question here I figure out the solution by my self... I post the solution here not only for my own reference, but also for others out there who will struggle with the same issue. I found this tutorial (see chapter 4.3) and figured I had to use weak delegates. Working like a charm!

Categories : Objective C

Blur borders on image via css
Whilst you can't apply a box-shadow directly to an image you could apply it with a :before or :after HTML <div class="shadow"> <img src="http://lorempixel.com/400/200/" /> </div> CSS .shadow { display:block; position:relative; } img { width: 100%; height: 100%; } .shadow:before { display:block; content:''; position:absolute; width:100%; height:100%; -moz-box-shadow:inset 0px 0px 3px 1px rgba(0,0,0,1); -webkit-box-shadow:inset 0px 0px 3px 1px rgba(0,0,0,1); box-shadow:inset 0px 0px 3px 1px rgba(0,0,0,1); }

Categories : HTML

How to blur image using CALayer
The documentation of the backgroundFilters property says this: Special Considerations This property is not supported on layers in iOS. As of iOS 6.1, there is no public API for applying live filters to layers on iOS. You can write code to draw the underlying layers to a CGImage and then apply filters to that image and set it as your layer's background, but doing so is somewhat complex and isn't “live” (it doesn't update automatically if the underlying layers change).

Categories : IOS

CSS image blur after a few seconds without hover
You can use a transition with CSS and add a transition delay. More about transition. More about CSS Blur.

Categories : CSS

How to have an image with css filter:blur and sharp edges?
The techniques I know about, nicely explained at http://demosthenes.info/blog/534/Crossbrowser-Image-Blur: 1..If you have an image that has the same color on all the outside edges, as in the example above, you could set the background-color of the body or a container element to the same color. (FYI; doesn't really apply to you, at least not in your fiddle). 2..Use the clip property to trim the edges of the image. clip is always stated in the following order: clip: rect( top, offset of right clip from left side, offset of bottom from top, left) For the example above, the image is 367px wide × 459 pixels high and the blur 2 pixels, so the clip would be stated as: clip: rect(2px,365px,457px,2px); (Note that clip is only applied to elements that have position: absolute applied to them.

Categories : CSS

Blur image with pixastic and set it as background with jquery
I'm not sure about first argument of css method and why you dont use img.src as url of image? Try something like this: $('.footer').css('background-image', 'url(' + img.src + ')'); Ok I found probably answer on documentation: var options = {}; Pixastic.process(image, "action", options); options.resultCanvas; // <- holds new canvas So in your case it would be: var img = new Image(), options = {}; options.amount = 1 img.src = '<?php echo $hd ?>'; img.onload = function() { Pixastic.process(img, "blurfast", options); $('.footer').css('background', "url(" + options.resultCanvas.toDataURL("image/png")+ ")" }); }

Categories : PHP

Blur a specific portion of a background image
You can overlay one picture with another (using divs) and blur the overlay. <div style="position: relative; background: URL(...)"> <div style="position: absolute; background: URL(...); top: ...; left: ...; width: ...; height: ...; filter: blur(3px)"> Update: Here it is in perfection: http://css-tricks.com/blurry-background-effect/

Categories : Javascript

Blur background - Jquery / Pure CSS / Image?
I don't know if this will help, but it gives a blur effect. A similar question was asked here: Background blur with CSS The developer used a svg blur to give a blur effect. Don't know if that helps.

Categories : Javascript

Fast Gaussian Blur image filter with ARM NEON
If this is specifically for 8 bit images then you really don't want floating point coefficients, especially not double precision. Also you don't want to use floats for x1, y1. You should just use integers for coordinates and you can use fixed point (i.e. integer) for the coefficients to keep all the filter arithmetic in the integer domain, e.g. Mat myGaussianBlur(Mat src){ Mat dst(src.rows, src.cols, CV_8UC1); Mat temp(src.rows, src.cols, CV_16UC1); // <<< int sum, x1, y1; // <<< // coefficients of 1D gaussian kernel with sigma = 2 double coeffs[] = {0.06475879783, 0.1209853623, 0.1760326634, 0.1994711402, 0.1760326634, 0.1209853623, 0.06475879783}; int coeffs_i[7] = { 0 }; // <<< //Normalize coeffs float coeffs_sum = 0.92302478

Categories : Opencv

html5 canvas background image blur and resize
Load the plain image, use a canvas to create a blurred version of the image, then turn that into a real image again for use in an <img> or css background: function blurImage(imgURL) { var img = new Image(); img.onload = function() { var canvas = document.createElement("canvas"); canvas.width = img.width; canvas.height = img.height; var context = canvas.getContext("2d"); context.drawImage(img,0,0); /* code that actually blurs the image goes here */ var dataURI = canvas.toDataUrl("image/png"); setBlurredImage(dataURI); }; img.src = imgURL; } with a set handler: function setBlurredImage(dataURI) { whateverElement.style.background = "url(" + dataURI + ")"; } And now you have a background image that is blurred.

Categories : HTML

translate image K2 using joomfish
I've found a possible solution. Maybe it's quite a trick, but it works. Since K2 doesn't store the path to the image into the database, I've used other fields that are stored. In particular, I've used the image_credits field. In that field I insert the path to the image (/images/myimage.jpg) that I've uploaded on the server via ftp or via any other means that allow you to upload a picture into the image folder. Now I've made some minor modifications into the template overrides of the item, adding an else branch to the if that manage the image <?php else: if(!empty($this->item->image_credits)): ?> <figure class="itemImageBlock"> <a class="itemImage modal" rel="{handler: 'image'}" href="<?php echo $this->item->image_credits; ?>" title="<?php echo

Categories : Joomla

How blur (focus lost) the image after insertion with execCommand in IE10?
You can work round this in several ways, but a simple one would be to use document.execCommand("InsertHTML") in most browsers, falling back to pasteHTML() in IE. However, this will not work in IE 11 because it does not support document.selection or the InsertHTML command. function insertImageWithInsertHtml(imgSrc) { var imgHtml = "<img src='" + imgSrc + "'>"; var sel; if (document.queryCommandSupported("InsertHTML")) { document.execCommand("InsertHTML", false, imgHtml); } else if ( (sel = document.selection) && sel.type != "Control") { var range = sel.createRange(); range.pasteHTML(imgHtml); range.collapse(false); range.select(); } } Another way which would work in all browsers except IE <= 8 (for which you can

Categories : Javascript

OpenGL iOS - apply blur on finger touch on image does not work
To continue from the comments: The approach you are taking doesn't seem a very good one at all. Fixing the 2 things from the comments will still produce other issues. To think of 1 it is what happens if user drags 2 lines at the same place? Will the image be blurred twice on that spot? It might but I can assure you it will lose its functionality. To look things a bit more general on what you are trying to do: You want the user to be able to select parts of the image to be blurred which is exactly what you should do. This results in you needing another buffer that will store only that data, either the pixel is blurry or not (can also store the strength of the blur). So in general I would suggest creating a FBO (frame buffer object) with attached texture. Then move the drawing code you alr

Categories : IOS

AngularJS submit on blur and blur on keypress
Here's what's happening: You press enter ng-keydown triggers (digest begins) You call target.blur() ng-blur triggers and attempts to start another digest cycle Angular complains The blur is executed synchronously and immediately triggers the handler without finishing the first digest. In my opinion, this is not a problem with your code, but rather an Angular bug. I've been trying to think of a better solution, but I can only find: app.controller('BlurCtrl', function($scope, $timeout) { $scope.blurModel = "I'm the value" $scope.blurOnEnter = function( $event ) { if ( $event.keyCode != 13 ) return // this will finish the current digest before triggering the blur $timeout(function () { $event.target.blur() }, 0, false); } $scope.onBlur = functi

Categories : Angularjs

Android - How to translate image path to content uri
This is how I did it. public static Uri getContentUri(Context context, File imageFile) { String filePath = imageFile.getAbsolutePath(); Cursor cursor = context.getContentResolver().query( MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, new String[] { MediaStore.Audio.Media._ID }, MediaStore.Audio.Media.DATA + "=? ", new String[] { filePath }, null); if (cursor != null && cursor.moveToFirst()) { int id = cursor.getInt(cursor .getColumnIndex(MediaStore.MediaColumns._ID)); Uri baseUri = Uri.parse("content://media/external/audio/media"); return Uri.withAppendedPath(baseUri, "" + id); } } Here my parameter is File, and finding path from it. You can pass the path itself.

Categories : Android

Undo translation made with Jquery Translate (Google Translate API v2)
Storing your translated content before you translate it may be the best solution. Since your using jquery anyway, take a look at .html() --> http://api.jquery.com/html/ Translation example: var content = $('.element').html(); $('.element').translate(); I suppose this is possible, but you will need to test this: var content = $('.element').html(); var translated_content = $(content).translate(); $('.element').html(translated_content); Now to return to original: $('.element').html(content); So wrap some functions and some event listeners around this and jobs done! Edit: alternative approach After rethinking my original approach above, think it's easier to just hide the original and add a translated copy. Note: Using .clone() has the side-effect of producing elements with dupli

Categories : Jquery

on blur of input field validate field and cancel blur event if not valid
I asked this question once, these are generally browser features which is not lock down a user to one input box. User should have choice of going away if they wanted, whether or not it is valid. So, Focus the same element after the blur event is disallowed. Edit: It seems chrome browser allows such effect such behavior but firefox and internet explorer does not.

Categories : Javascript

Applying custom image processing filters in Xamarin for iOS and Android
This question has an in-depth response about getting the values of individual pixels using Xamarin.iOS (MonoTouch). To do this in a platform agnostic way, you would probably need to create a BMP from the Image on each platform and then pass that to your library.

Categories : C#

Google translate pages does not translate whole page
The problem doesn't come from google translate, the problem comes from the personn that makes the page, the website does not use google translate to translate the page. if you insert your page in google translate website, you will have the exactly the same elements that are translated in russian and swedish

Categories : Misc

Add xamarin.ios and xamarin.android to portable class library
Here is what you need to do. Follow the thread here, if you hit any issues. Open an explorer window to C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETPortablev4.0ProfileProfile104SupportedFrameworks Create a new file in the folder named 'MonoTouch.xml' and put in the following content <?xml version="1.0" encoding="UTF-8"?> <Framework MinimumVersion="4.0" MaximumVersion="*" Profile="*" Identifier="MonoTouch" DisplayName="MonoTouch"/> Create a new file in the folder named 'MonoAndroid.xml' and put in the following content <?xml version="1.0" encoding="UTF-8"?> <Framework MaximumVersion="*" MinimumVersion="1.6" Profile="*" Identifier="MonoAndroid" DisplayName="Mono for Android"/> Restart Visual Studio if it is still open The options for MonoT

Categories : Visual Studio

Are there languages which compile to Objective-C or are binary compatible with Objective-C -> Coffeescript for Objective-C
While the primary way to use eero is to have it compile to native code, it does support source-to-source translation as well (from eero to standard Objective-C/C++). Please see https://github.com/eerolanguage/eero/wiki/Translator for more details. It really needs to be documented in a more obvious place...

Categories : IOS

glm translate matrix does not translate the vector
You're forgetting about projective coordinates. So the last component of glm::vec4 vector should be 1. So the correction is simply doing this: glm::mat4 translate = glm::translate(glm::mat4(1.f), glm::vec3(2.f, 0.f, 0.f)); glm::vec4 vector(1.f,1.f,1.f,1.f); glm::vec4 transformedVector = translate * vector; This is due to the way projective coordinates work, essentially to get from projective coordinates (vec4) to normal coordinates (vec3) you divide by w component. (Which you can't do if it's zero.) The reason it works for rotations but not translations is because in projective space rotations are "the same" as in normal space, but translations are different. I've just noticed that you worked out your error but I thought an explanation may help.

Categories : C++

Image not being called Objective-C
You need to do something like this: UIImageView *imageView = [cell.contentView viewWithTag:0017]; imageView.image = [UIImage imageNamed:@"reload.png"]; UIImages aren't UIView subclasses. Notice how in your second block of code you are adding a UIImageView to the cell and not a UIImage.

Categories : Objective C

How to crop the image in objective c?
CGRect clippedRect = CGRectMake(0 ,0,180 ,180); CGImageRef imageRef = CGImageCreateWithImageInRect(imgVw1.image.CGImage, clippedRect); UIImage *newImage = [UIImage imageWithCGImage:imageRef]; CGImageRelease(imageRef); imgVw1Cliped.image=newImage; NSLog(@"%d",imgVw1Cliped.image.imageOrientation);

Categories : Iphone

Image Checkbox in Objective-C
You are testing that sender == selected hence implying that sender is of type UIImage, and then sending setImage: to sender... with itself as parameter. This doen't make sense. I think what you were trying to do must look something like: -(IBAction) setCheckBox2: (UIImageView *) sender { UIImage *selected = [UIImage imageNamed:@"female.tiff"]; UIImage *notSelected = [UIImage imageNamed:@"male.tiff"]; if (sender.image == selected) { [sender setImage:notSelected]; } else { [sender setImage:selected]; } }

Categories : Iphone

Objective c How to scale image view size (height) as per image size
You can use the following code snippet which will meets your requirements -(UIImage *)adjustImageSizeWhenCropping:(UIImage *)image { float actualHeight = image.size.height; float actualWidth = image.size.width; float ratio=300/actualWidth; actualHeight = actualHeight*ratio; CGRect rect = CGRectMake(0.0, 0.0, 300, actualHeight); // UIGraphicsBeginImageContext(rect.size); UIGraphicsBeginImageContextWithOptions(rect.size, NO, 1.0); [image drawInRect:rect]; UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return img; }

Categories : Iphone

Objective-C UITableView cell image
try cell.imageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL: [NSURL URLWithString:[NSString stringWithFormat:@"http://graph.facebook.com/%@/picture", thisFriend.friendID]]]];

Categories : IOS

Caching or saving an image from web Objective C
Sure, you can save the file to disk yourself and check if it exists before you try to load it (all based on URL matching). There are also libraries that will do this kind of stuff for you like SDWebImage / HJCache.

Categories : Objective C

Upload an image directly to app without server in objective-c?
Storing the file locally will mean it's persisted, but only (guaranteed) if you put it in the correct place. You also want to consider the cost to the user when they backup their device and whether this information should be saved too. Check the docs for the file system here. Basically to: Save it and have it backed up, use Documents. Save it but avoid the backup, check this answer.

Categories : IOS

Objective C copying captcha image to clipboard
No way to paste in imageView, just you load the web view. like that, [self.captchaWebView loadHTMLString:@"<html><head><style type='text/css'>a {color:white;font-size:20px;font-style:bold}small{color:white;font-size:20px;font-style:bold}</style><script type='text/javascript'>var a = 49; b= 65; var c =100; var d = 70;var f=85;function DrawCaptcha(){if(a==57){a=49;}var main = document.getElementById('captchaText'); var a1=String.fromCharCode(a);var b1=String.fromCharCode(b);var c1=String.fromCharCode(c);var d1=String.fromCharCode(d);var f1=String.fromCharCode(f);main.innerHTML = a1+b1+c1+d1+f1;a=a+1;b=b+1;c=c+1;d=d+1;f=f+1;}function ValidCaptcha(){var str1=document.getElementById('captchaText').innerHTML;var str2=document.getElementById('txtinput').value;if(st

Categories : Objective C

Extracting latitude and longitude from image Objective c
I had a similar issue once. While dealing with it I got the impression that UIImage sort of strips all or some of the EXIF data. EXIFJpeg worked fine for me when the image data was read from file, boundle or webservice etc. direclty but I did not manage to extract any reasonalbe EXIFs when I stored the image in memory as UIImage object and then used UIImageJPEGRepresentaiion to get the image data and the EXIF from that data. I will not sign this in blood but that was my impression and using the "raw" data from file did actually work for me. So I received the file from some server, then extracted the EXIF including geo tags (if any) and after that created the UIImage.

Categories : IOS

Delayed displaying of image view objective c
imageView.alpha = 0; // Not visible imageView.alpha = 1; // Visible You can put it under obe of your UIButton action. In order for it to be on top of everything just drag the image view to be at the lowest level inside the interface builder.

Categories : IOS

Create an image cropping interface for Objective C (Mac OS X)
Here is a project you can look at: https://github.com/foundry/drawingtest It's a little demo I made as I was trying to understand the relationship between the rects in this method: - (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta Note that the older compositeToPoint: methods are deprecated and should not be used for this sort of thing. srcRect is the portion of the original image (in it's own coordinates) that you want to keep. dstRect is the rect that you want that cropped area to draw into. JMRect in the project is an NSObject representation of an NSRect - so that we can use cocoa bindings to tie the interface controls together. For your UI, the cropping rectangle could jus

Categories : Objective C

Objective-C/CocoaHTTPServer - Return an image how response
The problem is how you access the assets-library URL. This is not a standard URL and loading the data from an assets-library URL does not work like this. Here is an example how to do it: Getting NSData from an NSURL The following code is based on the above example. I'm not an expert in ALAssetLibrary, so try it with care. It needs quite some code to make the asynchronous working of the asset library synchronous again: - (NSObject<HTTPResponse> *)httpResponseForMethod:(NSString *)method URI:(NSString *)path{ HTTPLogTrace(); if ([path isEqualToString:@"/testPhoto"]){ NSData* __block data = nil; dispatch_semaphore_t sema = dispatch_semaphore_create(0); dispatch_queue_t queue = dispatch_get_main_queue(); ALAssetsLibraryAssetForURLResultBlock

Categories : IOS

Objective-C - Cut Image Based on Etched Line Borders
You can try this code since I am also doing to same thing for Image cropping from UIWebview : UIGraphicsBeginImageContext(self.view.bounds.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); CGRect rect = **your cropping CGREct**; CGImageRef imageRef = CGImageCreateWithImageInRect([viewImage CGImage], rect); UIImage *imgRect = [UIImage imageWithCGImage:imageRef]; CGImageRelease(imageRef); hope this will help you

Categories : Iphone



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.