w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Capture still image be stretched with Cocoa Touch AVFoundation framework
I think I shouldn't draw image with the size of screen.I should draw image with the size of image. I have defined new method to scale image to new width +(UIImage*)imageWithImage: (UIImage*) sourceImage scaledToWidth: (float) i_width; Now I called this method UIImage *newImage=[ImageUtility imageWithImage:image scaledToWidth:screenWidth]; [newImage drawInRect:CGRectMake(0, 0, newImage.size.width, newImage.size.height)]; Finally write the new image to photo album.The new image doesn't stretch.

Categories : Iphone

iOS : AVFoundation Image Capture Dark
I had the same issue on an iOS 7 5th gen ipod touch, but not on a 4th gen ipod touch with iOS 6.1. I found that the fix is to show a preview of the camera: // Setup camera preview image AVCaptureVideoPreviewLayer *previewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:_captureSession]; [_previewImage.layer addSublayer:previewLayer]; As instructed at https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/04_MediaCapture.html#//apple_ref/doc/uid/TP40010188-CH5-SW22 Note: I did not investigate accomplishing this without a preview

Categories : IOS

Image getting stretched when creating MBTiles using TileMills to use as an Image on Whirly Globe Framework
The image is less about dimensions and more about mapping it to geographic coordinates so that it can completely cover the globe. You need to make sure the image takes up your whole TileMill map if you want it to completely cover the globe in WhirlyGlobe.

Categories : Iphone

Custom camera app in android problems - rotation 270, stretched capture view and not getting all functions
If you getting problem with custom camera then please use intent camera with below code so image rotation is possible Bitmap bm = BitmapFactory.decodeStream(new FileInputStream(mFile), null, mBitmapFactoryOptions); Bitmap bitmap = bm; ExifInterface exif = new ExifInterface(ImagePath); int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1); Log.e("ExifInteface .........", "rotation =" + orientation); // exif.setAttribute(ExifInterface.ORIENTATION_ROTATE_90, 90); Log.e("orientation", "" + orientation); Matrix m = new Matrix(); if ((orientation == ExifInterface.ORIENTATION_ROTATE_180)) { m.postRotate(180); // m.postScale((float) bm.getWid

Categories : Java

Cocoa touch - Error getting JSON key
If you inspect your json you'll see that screen_cap_url_medium is under channel object, so you can access it like this: [dictionary valueForKeyPath:@"channel.screen_cap_url_medium"]; PS. Here dictionary is obviously the first object of the root array you get back from your response.

Categories : Json

Cocoa Touch JSON Handling
OK for anyone reading this. I just figured it out. Instead of formatting the initial NSData into a dictionary, you put that straight into an array. Then create a dictionary for each object in the array. Like so: NSArray *response = [NSJSONSerialization JSONObjectWithData:responseData options:kNilOptions error:&error]; NSDictionary* json = [responseArray objectAtIndex:0]; NSLog (@"%@",[json objectForKey:@"nickname"]);

Categories : Objective C

UITableViewCell from Cocoa Touch to Monotouch
You will need to create a xamarin.ios binding for the objective-c library. You can see how to do this here. There is a tool available from Xamarin called Objective Sharpie which will give you a great starting point! Here is a walkthrough to create a static library in Xcode

Categories : Objective C

static void pointer in AVFoundation.Framework in sample code
A self-referencing pointer static void *foo = &foo; is just a method to create a unique pointer at compile time. In that "AVSimpleEditoriOS" sample project, these pointers are later used as context parameter for [self addObserver:self forKeyPath:@"player.currentItem.status" options:NSKeyValueObservingOptionNew context:AVSEPlayerItemStatusContext]; and [self addObserver:self forKeyPath:@"playerLayer.readyForDisplay" options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew context:AVSEPlayerLayerReadyForDisplay]; The actual value of the context parameter does not matter at all, it is just some unique value that is passed to - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { if (co

Categories : IOS

How to prioritize an action (Make it go first) in Cocoa Touch
Are you hooking up the buttons to their actions in code, or in Interface Builder? You could change the "." button's decimalPressed: method to be called on "touch down inside" instead of "touch up inside". Make sure the digitPressed: method is called on "touch up inside". This would ensure that decimalPressed: is called first, when the button is pressed down, then digitPressed: is called when the button is released. You can do this either directly in code, or using Interface Builder in Xcode.

Categories : IOS

Cocoa-Touch Back Button with Tabbed Navigation
I believe what you want is navigation controllers for each item in the slide out menu. This way when the user selects a view from the side menu they can navigate the views associated with that section. This will allow the user to go back from a view once they have selected a item from the side menu.

Categories : IOS

Creating a Selection Menu using Cocoa Touch and Objective C
How about using a UINavigationController and pushing an UITableViewController with a list of themes on the navigation stack? You are not limited in the number of themes you can offer and it should be pretty easy to do. Or you could use [UIViewController presentViewController:animated:completion:] with modalTransitionStyle set to UIModalTransitionStyleFlipHorizontal.

Categories : Objective C

NSXMLDocument not has in Cocoa Touch
Probably you should try to set this data using next methods: setCharacterEncoding: setStandalone: setVersion: See NSXMLDocument reference for details

Categories : Objective C

iOS: How to get a piece of a stretched image?
You should be able to do this by rendering abcImageView to a UIImage UIGraphicsBeginImageContextWithOptions(abcImageView.bounds.size, NO, 0.f); [abcImageView.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); Then, you can crop the image like this (given cropRect): CGImageRef cgImage = CGImageCreateWithImageInRect(image.CGImage, cropRect); UIImage *croppedImage = [UIImage imageWithCGImage:cgImage]; // Do something with the image. CGImageRelease(cgImage);

Categories : IOS

Image is not stretched to the whole client area
The problem is your outer Grid. A Grid will re-size to fit the size of its children, but the child in this case (the Image) is trying to stretch to fill the size of its parent so I'm going to guess that what you are seeing is the image being drawn actual size. Try using a DockPanel instead which fills all available parent space children. <Window x:Class="Edge.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <DockPanel Background="Blue"> <Image Source="Images/House.png" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Stretch="Fill" Margin="3"/> </DockPanel> </Window>

Categories : Wpf

Stretched background image in subview
I think there might be an easier way to accomplish what you are wanting to do. If I understand you correctly, you're looking to have image.png be a background image for your custom view. If so, all you'll need to do is add a UIImageView when you initialize your custom view. - (id) initWithCoder: (NSCoder *) coder { self = [super initWithCoder: coder]; if (self) { UIImageView *imageView = [[UIImageView alloc] initWithFrame: self.bounds]; [imageView setAutoresizingMask: (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth)]; [imageView setImage: [UIImage imageNamed: @"image.png"]]; [self addSubview: imageView]; } return self; }

Categories : Objective C

UIbarbuttonItem image looks stretched/thicker
Could you try to create your UIBarButtonItems in your viewDidLoad method? Here is how I do with a UINavigationBar and all images looks fine: UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *rightButtonImage = [UIImage imageNamed:@"img1.png"]; [rightButton setImage:rightButtonImage forState:UIControlStateNormal]; rightButton.frame = CGRectMake(0.0, 7.0, rightButtonImage.size.width, rightButtonImage.size.height); [rightButton addTarget:self action:@selector(method1) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithCustomView:rightButton] autorelease]; UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom]; UIImage *leftButtonImage = [UIImage imageNamed:"img2.png"]; [leftBut

Categories : Iphone

IOS tableview: stretched image not display until scroll done
What you want to do is to put your image stretching function in the - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath delegate method. Only at this point will you know the actual size of the table cell to be displayed. Then you can stretch the bubble image to your heart's content.

Categories : Iphone

Image getting stretched when displayed in rounded imageview
You should resize your bitmap by its width/height rate. ----EDITED---- This will be a more flexible way to do it. @Override protected void onDraw(Canvas canvas) { Drawable drawable = getDrawable(); if (drawable == null) { return; } if (getWidth() == 0 || getHeight() == 0) { return; } Bitmap b = ((BitmapDrawable) drawable).getBitmap(); Bitmap bitmap = b.copy(Bitmap.Config.ARGB_8888, true); int w = getWidth(), h = getHeight(); int radius = w < h ? w : h; Bitmap roundBitmap = getCroppedBitmap(bitmap, radius, w, h); // roundBitmap= ImageUtils.setCircularInnerGlow(roundBitmap, 0xFFBAB399, // 4, 1); canvas.drawBitmap(roundBitmap, 0, 0, null); } public static Bitmap getCroppedBitmap(Bitmap bmp, int radius, int w, in

Categories : Android

How to prevent C++ name mangling in a Cocoa framework
You need to add extern "C" to the function implementation as well as the declaration. If the implementation of the function is in a .mm (Objective-C++) file, it will be compiled as Objective-C++, with name mangling. It doesn't matter that you happen to have an extern "C" declaration for a function with the same name. They are still seen as two different things. So wrap your implementation in extern "C" as well to remove the name mangling for the function implementation: extern "C" void display(NSString *text) { } Or: extern "C" { void display(NSString *text) { } } Also, if you want your header to be usable by C code, you will need to add an #ifdef to only use extern when compiling as C++. extern is not a valid keyword in C: #ifdef __cplusplus extern "C" { #endif void

Categories : C++

How to define a global variable in a Cocoa Framework
Like this + (instancetype)sharedMyClass { static id kSharedMyClass = nil; static dispatch_once_t theOnceToken; dispatch_once( &theOnceToken, ^{ kSharedMyClass = [[self alloc] init]; } ); return kSharedMyClass; }

Categories : Objective C

How to capture and record iOS Touch Events at system level?
Take a look at EntryDevLevel excellent answer here on how to capture and record clicks on iOS using iOHID: iOS touch event notifications (private API) BTW. His solution works on non jailbroken iOS either.

Categories : Iphone

File not found error for .app file when running logical unit tests in Cocoa Touch
In my target settings under Bundle loader I had "$(BUILT_PRODUCTS_DIR)/MyApp.app/MyApp" (notice the space). I removed the space and still didn't work. I removed the quotes as well and then it worked fine!

Categories : Xcode

Passing references to viewControllers to other viewControllers cocoa touch
There's nothing really wrong about this. If it works for you, than it's ok. Just make sure to have a weak reference to the view controller, otherwise you could have a memory leak with retain cycle. Read this for more information: http://www.cocoawithlove.com/2009/07/rules-to-avoid-retain-cycles.html Speaking about design, it's really depends of each case. I could't say preciselly because you didn't give more informations about the funcionality that you are trying to achieve. Maybe if you want to make your code more generic, to be used in other places or projects, you might consider to perform a delegate to your view controller, but this depends of your views hierarchy and its design. To see more information about passing data between viewControllers, please see this: Passing Data betw

Categories : IOS

How can i touch image during animation? or am i able to touch it or not?
add UIViewAnimationOptionAllowUserInteraction to the animation options also make sure userInteractionEnabled is YES on the image view edit: it seems that you are testing for a touched view which is touched before an image view is created? that last if statement will never be entered. You create a nil event and then test if its view (which will be nil) is equal to the new view, this doesnt make sense. What are you trying to do here?

Categories : IOS

Cocoa Scrolling Image Menu
The standard way to do this is to create a NSScrollView and nest a NSImage in it. You could run into problems if your continuous image is too large, however. In that case you'd want to split it into multiple NSImages and arrange them next to each other in the NSScrollView.

Categories : Osx

how to copy image in NSPasteBoard cocoa os x?
- (IBAction)copy:sender { NSImage *image = [imageView image]; if (image != nil) { NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; [pasteboard clearContents]; NSArray *copiedObjects = [NSArray arrayWithObject:image]; [pasteboard writeObjects:copiedObjects]; } } - (IBAction)paste:sender { NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; NSArray *classArray = [NSArray arrayWithObject:[NSImage class]]; NSDictionary *options = [NSDictionary dictionary]; BOOL ok = [pasteboard canReadObjectForClasses:classArray options:options]; if (ok) { NSArray *objectsToPaste = [pasteboard readObjectsForClasses:classArray options:options];

Categories : Osx

Sencha touch - debug framework?
When you build application use 'testing' target. sencha app build production vs sencha app build testing That if you build from command line. Not really sure how Architect handles that, but I'm pretty sure it calls same scripts/program underneath.

Categories : Extjs

Is Sencha Touch a UI framework that can (or should?) be used with PhoneGap?
Well, Sencha Touch is totally different from PhoneGap. PhoneGap in a nutshell gives you javascript APIs which access native apis on many mobile platform. Sencha Touch 2 is essentially a cross-platform mobile web framework. Although several native apis are introduced in Sencha Touch 2, please note that it's not the most important thing which makes ST2 outstanding. ST2 is best known for its solid and flexible class system, rapid mobile-web application development (then probably packaged as a native app), and robust UI customization as it utilizes SASS well. It seems you are new to ST2, so please read the following articles carefully: http://docs-origin.sencha.com/touch/2.2.1/#!/guide/getting_started http://docs-origin.sencha.com/touch/2.2.1/#!/guide/first_app And especially you have to

Categories : Jquery

In Cocoa how to resize an Image and animate the resizing?
I found it by my self... If anyone has the same necessity here's the solution: [[NSAnimationContext currentContext] setDuration:3.0]; NSRect rect = NSMakeRect(102.0, 59.0, 608.0, 533.0); //give the new dimensions here... first 2 numbers are the position of the object (X,Y) and other 2 numbers are the dimensions (width, height) [[myImage animator] setFrame:rect];

Categories : Objective C

Android image map. - displaying an .svg and using it as an image map (touch zones)
Not sure if this is the sort of thing you are after but here is an example of click enabled svg in a Android WebView: WebView webView = (WebView) findViewById(R.id.webView1); webView.getSettings().setJavaScriptEnabled(true); webView.loadUrl("http://www.w3.org/TR/SVG/images/script/script01.svg"); It should show a red circle that you can click on and the circle changes size. Here is the same example reworked with the svg loaded from the assets folder and an android javascript interface exposed so you do callbacks into android code from your svg file. WebView webView; public class WebAppInterface { /** Show a toast from svg */ @JavascriptInterface public void showToast(String toast) { Toast.makeText(MainActivity.this, toast, Toast.LENGTH_SHORT).show(); } }

Categories : Android

What framework to use for touch input tracking for Windows Store app using C#, XAML
You can use Pointer Events, that support both mouse and touch PointerPressed and PointerReleased Events You can check more here : Quick Start: Touch Inputs

Categories : C#

Capture the screen image without screen capture spamming
like LogMeIn does or Join.Me in Java Don't know what those applications do. Maybe Screen Image will do what you want. You can get an image of the desktop or any component in your Java application.

Categories : Java

touch/resources/sass/sencha-touch/base Failed to load resource error sencha touch 2
That is purely my fault .. In index.html I added base.scss file instead of adding base.css ,that is why it raising an error.I updated my index.html and now it is working fine . Thank you for those who helped me

Categories : Extjs

(Android Layout) Solution for Place button on top of the irregular shaped image or get touch detection(touchable area) of particular area of image?
The FLAG_WINDOW_IS_OBSCURED flag has worked well for me in the past but it may take some working with to get right. It may be worth a try but to be honest I'm still not sure exactly how it determines what is and isn't obscured, so it may not be applicable here. static OnTouchListener listenerMotionEvent = new OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if ( (motionEvent.getFlags() | MotionEvent.FLAG_WINDOW_IS_OBSCURED) != MotionEvent.FLAG_WINDOW_IS_OBSCURED ) { return false; // View is not obscured so we pass on the event } // Process the motion event here and return true if you consume it };

Categories : Android

Detecting an image capture
There is no broadcast action available to filter the image capture action being performed. Check in the link http://developer.android.com/reference/android/content/Intent.html#ACTION_CAMERA_BUTTON, only "android.intent.action.CAMERA_BUTTON" is available to detect the "camera button" pressed.

Categories : Android

Image Capture in BufferedImage
Your problem is that you never paint the original image (im, read from "Desert.jpg") into any of your screenCopy or screenCopy1 images, you only create empty BufferedImages of the same size. These "copies" will always stay blank.

Categories : Java

Image Capture on Windows 8 Tablet
I have tried this method just a day back with small modifications in the code.For me the image stream as well as the capture is working great.i will place my code here.you can have your modification for application to work for you. Imports System.Runtime.InteropServices Imports System.IO Public Class FrmCam Const WM_CAP As Short = &H400S Const WM_CAP_DRIVER_CONNECT As Integer = WM_CAP + 10 Const WM_CAP_DRIVER_DISCONNECT As Integer = WM_CAP + 11 Const WM_CAP_EDIT_COPY As Integer = WM_CAP + 30 Public Const WM_CAP_GET_STATUS As Integer = WM_CAP + 54 Public Const WM_CAP_DLG_VIDEOFORMAT As Integer = WM_CAP + 41 Const WM_CAP_SET_PREVIEW As Integer = WM_CAP + 50 Const WM_CAP_SET_PREVIEWRATE As Integer = WM_CAP + 52 Const WM_CAP_SET_SCALE As Integer = WM_

Categories : Windows

how to capture listview data as Jpg image
You can create HTML from your data using one of the many templating libraries out there like, if you have a String list Apache's Velocity might work well. After you create your HTML you can use java-html2image to convert your html to an image.

Categories : Android

HTML image that capture no space in UI
If your goal is to use the image for tracking/etc, the best way around is to position the image off screen. like this: <img style="width: 0px; height: 0px; position:absolute; left:-100px; top:-100px;" src="demoImage.jsp" />

Categories : HTML

capture image using front camera
Rather than use Camera.open(), you need to use the version of open() that takes the ID of the camera that you want. To find this ID, call getNumberOfCameras() on Camera, iterate over them, and find the one whose Camera.CameraInfo indicates that it is front-facing: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { Camera.CameraInfo info=new Camera.CameraInfo(); for (int i=0; i < Camera.getNumberOfCameras(); i++) { Camera.getCameraInfo(i, info); if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { camera=Camera.open(i); } } } if (camera == null) { camera=Camera.open(); }

Categories : Android



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