I am developing photography app. In that i need to create frame for `NSImage` i have done using drawing like this

```
NSImage *fg_img = [[NSImage alloc]initWithData:[NSData dataWithContentsOfFile:filepath]];
        //NSData *imageData1 = [NSData dataWithContentsOfURL: [NSURL encryptedFileURLWithPath:str]] ;
        NSImage *bg_img = [[NSImage alloc]initWithContentsOfURL:[NSURL encryptedFileURLWithPath:str]];

    NSImage *newImage ;

    NSRect imageRect = NSMakeRect(0,0, fg_img.size.width+fg_img.size.width/5, fg_img.size.height+fg_img.size.height/5);
    newImage = [[NSImage alloc] initWithSize: NSMakeSize(imageRect.size.width,imageRect.size.height)];
    NSRect fgrect = NSMakeRect(imageRect.size.width*0.03,imageRect.size.height*0.04, imageRect.size.width-imageRect.size.width/15.5, imageRect.size.height-imageRect.size.height/12);

    [newImage lockFocus];

    [fg_img drawInRect:fgrect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
    [bg_img drawInRect:imageRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];

    [newImage unlockFocus];

```

but its not clear..

the original frame image

![my original frame is](https://i.stack.imgur.com/wgNfJ.png)

when I scaling it output is 
![enter image description here](https://i.stack.imgur.com/IuKeS.png)

In above picture the width of the frame has changed when I resize frame image.
I need without changing width of frame image when scaling. 

updated:

but your code display like this

![preview](https://i.stack.imgur.com/jiFFT.jpg)

if i give big picture the base image become very thin