|
i rotate an image using this
- (NSImage*)imageRotatedByDegrees_Angle:(CGFloat)degrees
{
[[NSGraphicsContext
currentContext] setImageInterpolation: NSImageInterpolationNone];
NSRect imageBounds = {NSZeroPoint, [self size]};
NSBezierPath* boundsPath = [NSBezierPath bezierPathWithRect:imageBounds];
NSAffineTransform* transform = [NSAffineTransform transform];
[transform rotateByDegrees:-1.0 * degrees];
[boundsPath transformUsingAffineTransform:transform];
NSRect rotatedBounds = {NSZeroPoint, [boundsPath bounds].size};
imageBounds.origin.x = NSMidX(rotatedBounds) - (NSWidth(imageBounds) / 2);
imageBounds.origin.y = NSMidY(rotatedBounds) - (NSHeight(imageBounds) / 2);
NSImage* rotatedImage = [[NSImage alloc] initWithSize:rotatedBounds.size];
NSAffineTransform* transform1 = [NSAffineTransform transform];
[transform1 translateXBy:+(NSWidth(rotatedBounds) / 2)
yBy:+(NSHeight(rotatedBounds) / 2)];
[transform1 rotateByDegrees:-1.0 * degrees];
[transform1 translateXBy:-(NSWidth(rotatedBounds) / 2)
yBy:-(NSHeight(rotatedBounds) / 2)];
[NSGraphicsContext saveGraphicsState];
[[NSGraphicsContext currentContext]
setImageInterpolation:NSImageInterpolationHigh];
[rotatedImage lockFocus];
[transform1 concat];
[self drawInRect: imageBounds fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0];
[rotatedImage unlockFocus];
[NSGraphicsContext restoreGraphicsState];
return rotatedImage;
}
image is rotated but the rotated image is so blurry.
Does anyone know how to solve it?
please help me for this.
|
|
|
|
|
Hi all,
i have two different NSMutableArray one is source array and other is backup array,
on some action copy the source array value to backup array.
than continue the changes in source array objects.
but here the backup array objects value automatically changed as i changed in source array.
please help me i don't want to change backup array object even i change in source array object.
thanks in advance.
|
|
|
|
|
I do not know Objective-C or Swift, but your description sounds like you have copied the object references instead of the actual content.
|
|
|
|
|
help me how can i correct this...
|
|
|
|
|
As I stated in my previous message, "I do not know Objective-C or Swift". So you need to look at what your code is actually doing and why it is not doing deep copy operations. Hint: you could always try the documentation for whichever language you are using.
|
|
|
|
|
You need to clone the contents of the source array. [copy] method of NSMutableArray makes a reference copy with new array variable hence your content in backup array gets updated when you update source array. Use
NSMutableArray initWithArray to create a clone of source array but with new reference pointer to it. Hope it helps.
|
|
|
|
|
I don't think this message was meant for me.
|
|
|
|
|
hi all,
please guide me to how to access connected webcam in my machine and capture the image from camera.
thanks in advance.
|
|
|
|
|
What machine are you trying to access the web camera from? What language are you using?
This space for rent
|
|
|
|
|
i have mac mini and use objective c for this.
|
|
|
|
|
Check the documentation of your camera. The manufacturer might also provide an SDK with example code.
If that does not help search the web using the keywords Mac and/or Objective-C and your camera model.
|
|
|
|
|
thank u
i found a sample
[^]
but here not explain how to i use it in my nswindowcontroller class.
please help
|
|
|
|
|
I'm sorry but I have not programmed for the Mac so far.
How about using the comment section at your link?
|
|
|
|
|
Hi all,
i want to add textfield and checkbox in a box.
i use size to fit option for fox after adding control, its resize the box but change the location of box upward .
i don't want to change the location of box,
i want when i add control box increase height at downward.
please help me for this.
|
|
|
|
|
|
Member 13195612 wrote: Need help You certainly do.
|
|
|
|
|
hi all,
when i trying to print or preview multiple pages from my application
i got this
exception
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.'
i really don't understand
what can i do here.
in printing i pass an image creating from rendering of my customise view.
please help me for this.
if there is a one page its working fine
but when i create different image at time of printing its crash
crash log:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 7
Application Specific Information:
abort() called
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.'
Thread 7 Crashed:
0 libSystem.B.dylib 0x00007fff837d59ce __semwait_signal_nocancel + 10
1 libSystem.B.dylib 0x00007fff837d58d0 nanosleep$NOCANCEL + 129
2 libSystem.B.dylib 0x00007fff838323ce usleep$NOCANCEL + 57
3 libSystem.B.dylib 0x00007fff83851a00 abort + 93
4 libstdc++.6.dylib 0x00007fff8791f5d2 __tcf_0 + 0
5 libobjc.A.dylib 0x00007fff8116cb39 _objc_terminate + 100
6 libstdc++.6.dylib 0x00007fff8791dae1 __cxxabiv1::__terminate(void (*)()) + 11
7 libstdc++.6.dylib 0x00007fff8791db16 __cxxabiv1::__unexpected(void (*)()) + 0
8 libstdc++.6.dylib 0x00007fff8791dbfc __gxx_exception_cleanup(_Unwind_Reason_Code, _Unwind_Exception*) + 0
9 libobjc.A.dylib 0x00007fff81168fa2 object_getIvar + 0
10 com.apple.CoreFoundation 0x00007fff800b45d7 +[NSException raise:format:arguments:] + 103
11 com.apple.CoreFoundation 0x00007fff800b4564 +[NSException raise:format:] + 148
12 com.apple.AppKit 0x00007fff8556086e -[NSPrintSpoolingGraphicsContext dealloc] + 37
13 com.apple.CoreFoundation 0x00007fff80030fc3 __CFArrayReleaseValues + 435
14 com.apple.CoreFoundation 0x00007fff8000eaa3 _CFRelease + 179
15 com.apple.AppKit 0x00007fff8500b53d __NSAppKitFinalizeThreadData + 260
16 libSystem.B.dylib 0x00007fff8379c751 _pthread_tsd_cleanup + 187
17 libSystem.B.dylib 0x00007fff8379c39c _pthread_exit + 147
18 com.apple.Foundation 0x00007fff83bd227f __NSFinalizeThreadData + 0
19 com.apple.Foundation 0x00007fff83bd2217 __NSThread__main__ + 1448
20 libSystem.B.dylib 0x00007fff8379bfd6 _pthread_start + 331
21 libSystem.B.dylib 0x00007fff8379be89 thread_start + 13
..
please help
modified 5-Apr-17 8:11am.
|
|
|
|
|
Before the task finish r u sending another image to print. The error seems to be like this. In case of multiple images all images should be in a queue , First come first serve. Till one job is not done . another image should wait.
|
|
|
|
|
i send image to printing one by one ,this happens when page is change to second page
on single page it print multiple images without any problem.
|
|
|
|
|
I want to get the magnetic induction intensity, light intensity, the object distance phone
|
|
|
|
|
|
hi all,
i have an image with god quality even when i view it in preview and zoom its gud and not pixelate.
i have create an custom view class derived from NSView, to draw text above and below the image. and resize the image
inside the custom view class in -drawRect method, i draw the text and image.
with help of NSMutableAttributedString drawinRect and NSImage drawInRect methods.
than get final image like this.
<pre lang="objc">
OffscreenView *view = [[OffscreenView alloc] initWithImage:myimage];
NSRect rect = [view bounds];
NSData *data = [view dataWithPDFInsideRect:rect];
NSImage *image_bar = [[NSImage alloc] initWithData:data];
buts this image quality is very badges compare to original image i pass to view.
please help me to get god quality image here.
modified 17-Jan-17 1:09am.
|
|
|
|
|
does it compressing the image volume as well .
|
|
|
|
|
|
Dear Members,
Is it possible for two apps to simultaneously access microphone under iPhone. We want to develop a Skype recorder for iPhone but need to determine the possibility.
In Android we were getting problem in shared access of microphone but on Windows 7 desktop shared mode for microphone worked.
Thanks,
|
|
|
|