how to make a resizable crop rectangle to crop image in Xcode? - xcode

We are trying to make a drawing application, for that we require code to work with images (cropping,resizing,rotating,merging etc. the works) problem is we are novices(less than five months in iOS) so we require some things along the lines of a tutorial as well as enable us build an application. Please help!

For cropping, you could follow the source code in my library. It will show you how to make a freehand crop tool and apply the cropping methods in core graphics.
https://github.com/nicholjs/BFCropInterface

Related

Mac Rounded Texture Button with custom image on inactive window

I can see that most apps use Rounded Texture Button for Toolbar commands on macOS. However I can't make those buttons look fully native if I use a custom image (vector or bitmap). The problem is that if the window is inactive, image is still painted the same and not semi-transparent. This works fine if I use the system provided images, so my guess is that it has something to do with the image definition, but I have tried various things (like using Assets or Resources, using vector and bitmap images) and still no success. As said I guess it is something simple, but hard enough that I can't find it, can anyone help?
You need to set the image as template image. Only then AppKit is able to render the image correctly in every circumstance.

Can I take a design done in Sketch and transfer it into Xcode's Storyboard?

I designed my apps UI using Sketch. Is there a way to transfer it directly into Xcode ie the storyboard? Or do I have to recreate the design from scratch using Xcode's Storyboard?
I've done it in pieces using Sketches, a program similar to Sketch. I exported each drawing from Sketches as a JPEG and then added the file in Xcode. You might want to use some intermediary program (such as Preview) to change the size of the drawing to exactly whatever you need for the app. If you've created an entire drawing of the proposed screen, you can use it as the background for a screen-sized imageView. Then you can place the appropriate UI elements and re-size them to match. Delete the imageView. With Auto Layout, you can set it to use the Canvas values to generate constraints as needed.

Creating an image for a Visual Basic command button?

I'm working on an application which was made in Visual Basic 6.0. It was been made 8-10 years ago. There are different images used on the different command buttons. I have made a new image for a new button, but the image is not matched with the other images and I don't want to change all the old images.
I have used Fireworks 8.0, MS Office Picture Manager and MS Paint. However, I have failed to make the image the same as the others. I have attached a screen shot of the application. The new image is highlighted in a red rectangle. I want all the buttons to look the same. The new image looks a little blurry; also, the font is smooth, which it shouldn't be because the others aren't smooth.
I have faced similar issue. I have tested the text of the image with some of the fonts and found that MS Sans Serif was matched with font of the other images. I wrote the text in MS-Paint then copied it and paste it with icon in Fireworks 8 and made the background transparent. It worked for me. You can try it. Hope this helps!
You just have to try to make your images look like the previous images.
Try to find out which font was used. Turn off anti-aliasing in the image editor - that might be why the text looks smooth.
Perhaps you are drawing your image rather larger than the space available in the buttons, and then it is being shrunk to fit at runtime? That could make it look blurry. And have you used more colours than the other images? And more "subtle" colours, but the colours in the other images are quite brash.

iPhoto-like cropping of an image?

I've been struggling over this for several days now and can't crack it. How do I achieve that neat photo cropping you see in iPhoto?
I tried using an NSImageView with a semi transparent CALayer allowing me to draw the cropping tool, but that doesn't work as the layer makes the image invisible (even though its transparency is set to 0.5).
I'm not asking for detailed code, just the global approach.
I found this outdated sample app from Apple which uses a subclass of NSImageView enhanced with cropping abilities. Although the project is based on PPC technology and it will not open in Xcode 4, the sources are exactly what I was looking for.

Region selection in canvas

I'm setting up an experimental html5 website using canvas.
I am drawing 3 circles all next to each other and all I want to know is how to be able to select them.
I'd like them to become links, in a way. Not tags, since everything's gonna be created using javascript.
Something like kinetic JS : http://www.kineticjs.com/, but without the extra library.
I have found some scripts that are using ghost canvas and contexts, but the examples are for dragging and stuff. I only want to be able to select my shape and execute some code.
Thank you!
I am thinking you might want to look into the IsPointInPath() method. It will help you figure out whether or not the mouse clicked on your canvas object.
See Detect mouseover of certain points within an HTML canvas?
if you are talented in xml i suggest you to use canvas + SVG (http://www.w3schools.com/svg/)
And follow this simple example.
http://jsvectoreditor.googlecode.com/svn/trunk/index.html
regarding to SVG and Canvas , the differences are obvious, as you can load bitmaps in SVG, and you can draw lines using the canvas API. However, creating the image may be easier using one technology over the other, depending on whether your graphic is mainly line-based or more image-like.

Resources