¡@

Home 

2014/10/15 ¤U¤È 10:05:00

iphone Programming Glossary: cgcolor

Rounded UIView using CALayers - only some corners - How?

http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how

YES l setCornerRadius 5.0 l setBorderWidth 2.0 l setBorderColor UIColor darkGrayColor CGColor Above code is applying the roundness to each of corners of supplied View. Instead I just wanted to apply.. setImage UIImage img UIImage imageNamed @ my_image.png int w img.size.width int h img.size.height CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGContextRef context CGBitmapContextCreate NULL w h 8.. imageNamed @ my_image.png int w img.size.width int h img.size.height CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGContextRef context CGBitmapContextCreate NULL w h 8 4 w colorSpace kCGImageAlphaPremultipliedFirst..

How to customize the background/border colors of a grouped table view cell?

http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell

Drawing code CGContextRef c UIGraphicsGetCurrentContext CGContextSetFillColorWithColor c fillColor CGColor CGContextSetStrokeColorWithColor c borderColor CGColor if position CustomCellBackgroundViewPositionTop.. CGContextSetFillColorWithColor c fillColor CGColor CGContextSetStrokeColorWithColor c borderColor CGColor if position CustomCellBackgroundViewPositionTop CGContextFillRect c CGRectMake 0.0f rect.size.height..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow.. 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect to it but I.. CGContextSaveGState context CGContextSetShadowWithColor context CGSizeMake 0.0f 1.0f 3.0f aColor CGColor Now fill the rectangle so the shadow gets drawn aColor setFill CGContextSaveGState context CGContextAddPath..

UIBarButtonItem with color?

http://stackoverflow.com/questions/664930/uibarbuttonitem-with-color

YES button.layer setBorderWidth 1.0f button.layer setBorderColor UIColor grayColor CGColor button.frame CGRectMake 0.0 100.0 60.0 30.0 button addTarget self action @selector batchDelete forControlEvents..

Rounded UIView using CALayers - only some corners - How?

http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how

@ any Url Here CALayer l imgVUserImg layer l setMasksToBounds YES l setCornerRadius 5.0 l setBorderWidth 2.0 l setBorderColor UIColor darkGrayColor CGColor Above code is applying the roundness to each of corners of supplied View. Instead I just wanted to apply roundness to selected corners like top top left bottom.. context CGContextRestoreGState context UIImage setImage UIImage img UIImage imageNamed @ my_image.png int w img.size.width int h img.size.height CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGContextRef context CGBitmapContextCreate NULL w h 8 4 w colorSpace kCGImageAlphaPremultipliedFirst CGContextBeginPath.. context UIImage setImage UIImage img UIImage imageNamed @ my_image.png int w img.size.width int h img.size.height CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGContextRef context CGBitmapContextCreate NULL w h 8 4 w colorSpace kCGImageAlphaPremultipliedFirst CGContextBeginPath context CGRect rect..

How to customize the background/border colors of a grouped table view cell?

http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell

Initialization code return self void drawRect CGRect rect Drawing code CGContextRef c UIGraphicsGetCurrentContext CGContextSetFillColorWithColor c fillColor CGColor CGContextSetStrokeColorWithColor c borderColor CGColor if position CustomCellBackgroundViewPositionTop CGContextFillRect c CGRectMake 0.0f rect.size.height 10.0f.. rect Drawing code CGContextRef c UIGraphicsGetCurrentContext CGContextSetFillColorWithColor c fillColor CGColor CGContextSetStrokeColorWithColor c borderColor CGColor if position CustomCellBackgroundViewPositionTop CGContextFillRect c CGRectMake 0.0f rect.size.height 10.0f rect.size.width 10.0f CGContextBeginPath c CGContextMoveToPoint..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

gradient CAGradientLayer layer gradient.frame CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect to it but I am not quite sure how to do this. I.. layer gradient.frame CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect to it but I am not quite sure how to do this. I suppose I would be required.. UIColor colorWithRed 0.0f green 0.0f blue 0.0f alpha 0.5f CGContextSaveGState context CGContextSetShadowWithColor context CGSizeMake 0.0f 1.0f 3.0f aColor CGColor Now fill the rectangle so the shadow gets drawn aColor setFill CGContextSaveGState context CGContextAddPath context path CGContextEOFillPath context Release the..

UIBarButtonItem with color?

http://stackoverflow.com/questions/664930/uibarbuttonitem-with-color

size 12.0f button.layer setCornerRadius 4.0f button.layer setMasksToBounds YES button.layer setBorderWidth 1.0f button.layer setBorderColor UIColor grayColor CGColor button.frame CGRectMake 0.0 100.0 60.0 30.0 button addTarget self action @selector batchDelete forControlEvents UIControlEventTouchUpInside UIBarButtonItem deleteItem..

How can i take an UIImage and give it a black border?

http://stackoverflow.com/questions/1354811/how-can-i-take-an-uiimage-and-give-it-a-black-border

How to style UITextview to like Rounded Rect text field?

http://stackoverflow.com/questions/1824463/how-to-style-uitextview-to-like-rounded-rect-text-field

border look very close to a UITextField textView.layer setBorderColor UIColor grayColor colorWithAlphaComponent 0.5 CGColor textView.layer setBorderWidth 2.0 The rounded corner part where you specify your view's corner radius textView.layer.cornerRadius..

Add text to CALayer

http://stackoverflow.com/questions/2209734/add-text-to-calayer

void drawLayer CALayer layer inContext CGContextRef ctx CGContextSetFillColorWithColor ctx UIColor darkTextColor CGColor UIGraphicsPushContext ctx word drawInRect layer.bounds withFont UIFont systemFontOfSize 32 lineBreakMode UILineBreakModeWordWrap..

Rounded UIView using CALayers - only some corners - How?

http://stackoverflow.com/questions/2264083/rounded-uiview-using-calayers-only-some-corners-how

layer l setMasksToBounds YES l setCornerRadius 5.0 l setBorderWidth 2.0 l setBorderColor UIColor darkGrayColor CGColor Above code is applying the roundness to each of corners of supplied View. Instead I just wanted to apply roundness to selected.. context UIImage setImage UIImage img UIImage imageNamed @ my_image.png int w img.size.width int h img.size.height CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGContextRef context CGBitmapContextCreate NULL w h 8 4 w colorSpace kCGImageAlphaPremultipliedFirst.. UIImage img UIImage imageNamed @ my_image.png int w img.size.width int h img.size.height CGColorSpaceRef colorSpace CGColorSpaceCreateDeviceRGB CGContextRef context CGBitmapContextCreate NULL w h 8 4 w colorSpace kCGImageAlphaPremultipliedFirst..

How to change an UILabel/UIFont's letter spacing?

http://stackoverflow.com/questions/2544905/how-to-change-an-uilabel-uifonts-letter-spacing

kCGEncodingMacRoman CGContextSetCharacterSpacing context 1 CGContextSetFillColorWithColor context UIColor clearColor CGColor CGAffineTransform myTextTransform CGAffineTransformScale CGAffineTransformIdentity 1.f 1.f CGContextSetTextMatrix context.. width v.x p.x float centeredX self.frame.size.width width 2 CGContextSetFillColorWithColor context self.textColor CGColor CGContextShowTextAtPoint context centeredX centeredY self.text cStringUsingEncoding NSASCIIStringEncoding self.text length..

UIImage rounded corners

http://stackoverflow.com/questions/262156/uiimage-rounded-corners

else if widthFactor heightFactor thumbnailPoint.x targetSize.width scaledWidth 0.5 CGContextRef mainViewContentContext CGColorSpaceRef colorSpace colorSpace CGColorSpaceCreateDeviceRGB create a bitmap graphics context the size of the image mainViewContentContext.. targetSize.width scaledWidth 0.5 CGContextRef mainViewContentContext CGColorSpaceRef colorSpace colorSpace CGColorSpaceCreateDeviceRGB create a bitmap graphics context the size of the image mainViewContentContext CGBitmapContextCreate.. NULL targetSize.width targetSize.height 8 0 colorSpace kCGImageAlphaPremultipliedLast free the rgb colorspace CGColorSpaceRelease colorSpace if mainViewContentContext NULL return NULL CGContextSetFillColorWithColor mainViewContentContext..

How do I use the NSString draw functionality to create a UIImage from text

http://stackoverflow.com/questions/2765537/how-do-i-use-the-nsstring-draw-functionality-to-create-a-uiimage-from-text

CGContextRef ctx UIGraphicsGetCurrentContext CGContextSetShadowWithColor ctx CGSizeMake 1.0 1.0 5.0 UIColor grayColor CGColor draw in context you can use also drawInRect withFont text drawAtPoint CGPointMake 0.0 0.0 withFont font transfer image UIImage..

Inner Shadow in UILabel

http://stackoverflow.com/questions/3231690/inner-shadow-in-uilabel

rect CGContextSetShadowWithColor UIGraphicsGetCurrentContext CGSizeMake 0 1 1.0f UIColor colorWithWhite 0.0 alpha 0.5 CGColor cutout drawAtPoint CGPointZero create negative image UIGraphicsBeginImageContextWithOptions rect.size NO 0 UIColor blackColor..

How to customize the background/border colors of a grouped table view cell?

http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view-cell

CGRect rect Drawing code CGContextRef c UIGraphicsGetCurrentContext CGContextSetFillColorWithColor c fillColor CGColor CGContextSetStrokeColorWithColor c borderColor CGColor if position CustomCellBackgroundViewPositionTop CGContextFillRect.. CGContextSetFillColorWithColor c fillColor CGColor CGContextSetStrokeColorWithColor c borderColor CGColor if position CustomCellBackgroundViewPositionTop CGContextFillRect c CGRectMake 0.0f rect.size.height 10.0f rect.size.width..

Inner shadow effect on UIView layer?

http://stackoverflow.com/questions/4431292/inner-shadow-effect-on-uiview-layer

CGRectMake 8 57 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect to it but.. 296 30 gradient.cornerRadius 3.0f gradient.colors NSArray arrayWithObjects id RGB 130 0 140 CGColor id RGB 108 0 120 CGColor nil self.layer insertSublayer gradient atIndex 0 I'd like to add an inner shadow effect to it but I am not quite sure how.. blue 0.0f alpha 0.5f CGContextSaveGState context CGContextSetShadowWithColor context CGSizeMake 0.0f 1.0f 3.0f aColor CGColor Now fill the rectangle so the shadow gets drawn aColor setFill CGContextSaveGState context CGContextAddPath context path..

Get RGB value from UIColor presets

http://stackoverflow.com/questions/4700168/get-rgb-value-from-uicolor-presets

predefined values like UIColor grayColor UIColor redColor . I know that I can use following code const CGFloat c CGColorGetComponents color.CGColor but only for colors that are in RBG color space however UIColor grayColor is not. Is there any.. UIColor grayColor UIColor redColor . I know that I can use following code const CGFloat c CGColorGetComponents color.CGColor but only for colors that are in RBG color space however UIColor grayColor is not. Is there any way to get RGB values for.. which don't have reasonable RGB values. void getRGBComponents CGFloat 3 components forColor UIColor color CGColorSpaceRef rgbColorSpace CGColorSpaceCreateDeviceRGB unsigned char resultingPixel 4 CGContextRef context CGBitmapContextCreate..

Drawing waveform with AVAssetReader

http://stackoverflow.com/questions/5032775/drawing-waveform-with-avassetreader

imageSize CGContextRef context UIGraphicsGetCurrentContext CGContextSetFillColorWithColor context UIColor blackColor .CGColor CGContextSetAlpha context 1.0 CGRect rect rect.size imageSize rect.origin.x 0 rect.origin.y 0 CGColorRef leftcolor UIColor.. blackColor .CGColor CGContextSetAlpha context 1.0 CGRect rect rect.size imageSize rect.origin.x 0 rect.origin.y 0 CGColorRef leftcolor UIColor whiteColor CGColor CGColorRef rightcolor UIColor redColor CGColor CGContextFillRect context rect CGContextSetLineWidth.. context 1.0 CGRect rect rect.size imageSize rect.origin.x 0 rect.origin.y 0 CGColorRef leftcolor UIColor whiteColor CGColor CGColorRef rightcolor UIColor redColor CGColor CGContextFillRect context rect CGContextSetLineWidth context 1.0 float halfGraphHeight..

UIBarButtonItem with color?

http://stackoverflow.com/questions/664930/uibarbuttonitem-with-color

4.0f button.layer setMasksToBounds YES button.layer setBorderWidth 1.0f button.layer setBorderColor UIColor grayColor CGColor button.frame CGRectMake 0.0 100.0 60.0 30.0 button addTarget self action @selector batchDelete forControlEvents UIControlEventTouchUpInside..