Click here to Skip to main content
15,796,333 members
Home / Discussions / Objective-C and Swift
   

Objective-C and Swift

 
QuestionHow can I decipher, or understand what I reading in an M4A file? Pin
SergioQ24-Jan-22 16:52
SergioQ24-Jan-22 16:52 
QuestionHow can I take data from PDF form to Excel on specified cells Pin
Member 146436033-Nov-19 23:18
Member 146436033-Nov-19 23:18 
AnswerRe: How can I take data from PDF form to Excel on specified cells Pin
Richard MacCutchan4-Nov-19 0:41
mveRichard MacCutchan4-Nov-19 0:41 
QuestionHow to get Idle time of mac? Pin
UJ728-Jul-18 0:57
UJ728-Jul-18 0:57 
AnswerRe: How to get Idle time of mac? Pin
Richard MacCutchan28-Jul-18 1:11
mveRichard MacCutchan28-Jul-18 1:11 
AnswerRe: How to get Idle time of mac? Pin
Vincent Reynolds20-Sep-19 12:23
Vincent Reynolds20-Sep-19 12:23 
AnswerRe: How to get Idle time of mac? Pin
Vitória Oliveira1-Oct-19 12:31
Vitória Oliveira1-Oct-19 12:31 
GeneralRe: How to get Idle time of mac? Pin
Ogladaj Znami13-Jan-22 23:17
Ogladaj Znami13-Jan-22 23:17 
QuestionHow to design game Pin
HerryF19-May-18 2:22
HerryF19-May-18 2:22 
AnswerRe: How to design game Pin
Richard MacCutchan19-May-18 3:08
mveRichard MacCutchan19-May-18 3:08 
GeneralRe: How to design game Pin
Coding Ninjas7-Jun-22 1:46
Coding Ninjas7-Jun-22 1:46 
GeneralRe: How to design game Pin
Richard Deeming7-Jun-22 1:57
mveRichard Deeming7-Jun-22 1:57 
AnswerRe: How to design game Pin
chipp_zanuff2-Nov-18 21:42
chipp_zanuff2-Nov-18 21:42 
QuestionRecently i decided to learn swift again[Help] Pin
HerryF8-Oct-18 21:15
HerryF8-Oct-18 21:15 
AnswerRe: Recently i decided to learn swift again[Help] Pin
Richard MacCutchan19-May-18 3:06
mveRichard MacCutchan19-May-18 3:06 
AnswerRe: Recently i decided to learn swift again[Help] Pin
Dennis E White9-Oct-18 10:45
professionalDennis E White9-Oct-18 10:45 
QuestionNSPrintOperation graphic context affect my custom print view? Pin
Le@rner4-Feb-18 19:04
Le@rner4-Feb-18 19:04 
QuestionNSPrintOperation not print properly Landscape print Pin
Le@rner30-Jan-18 21:13
Le@rner30-Jan-18 21:13 
Questionmy application crashed with this message NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.' Pin
Le@rner17-Jan-18 1:50
Le@rner17-Jan-18 1:50 
AnswerRe: my application crashed with this message NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.' Pin
Jochen Arndt17-Jan-18 2:07
professionalJochen Arndt17-Jan-18 2:07 
GeneralRe: my application crashed with this message NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.' Pin
Le@rner17-Jan-18 2:40
Le@rner17-Jan-18 2:40 
GeneralRe: my application crashed with this message NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.' Pin
Jochen Arndt17-Jan-18 2:56
professionalJochen Arndt17-Jan-18 2:56 
GeneralRe: my application crashed with this message NSInternalInconsistencyException', reason: 'Printing failed because PMSessionEndDocumentNoDialog() returned -30871.' Pin
Le@rner30-Jan-18 21:10
Le@rner30-Jan-18 21:10 
QuestionNSImage become blurry after transfromation Pin
Le@rner7-Jul-17 21:27
Le@rner7-Jul-17 21:27 
i rotate an image using this

- (NSImage*)imageRotatedByDegrees_Angle:(CGFloat)degrees
{
    [[NSGraphicsContext
      currentContext] setImageInterpolation: NSImageInterpolationNone];
    
    // Calculate the bounds for the rotated image
    // We do this by affine-transforming the bounds rectangle
    NSRect imageBounds = {NSZeroPoint, [self size]};
    NSBezierPath* boundsPath = [NSBezierPath bezierPathWithRect:imageBounds];
    NSAffineTransform* transform = [NSAffineTransform transform];
    [transform rotateByDegrees:-1.0 * degrees];// we want clockwise angles
    [boundsPath transformUsingAffineTransform:transform];
    NSRect rotatedBounds = {NSZeroPoint, [boundsPath bounds].size};
    
    // Center the image within the rotated bounds
    imageBounds.origin.x = NSMidX(rotatedBounds) - (NSWidth(imageBounds) / 2);
    imageBounds.origin.y = NSMidY(rotatedBounds) - (NSHeight(imageBounds) / 2);
    
    NSImage* rotatedImage = [[NSImage alloc] initWithSize:rotatedBounds.size];
    //NSSize new_size=[self size];
    

            NSAffineTransform* transform1 = [NSAffineTransform transform];
       
            [transform1 translateXBy:+(NSWidth(rotatedBounds) / 2)
                                yBy:+(NSHeight(rotatedBounds) / 2)];
            // Do the rotation
            [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.
QuestionNSMutableArray copy problem Pin
Le@rner26-Jun-17 22:19
Le@rner26-Jun-17 22:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.