/
posts.html
420 lines (352 loc) · 20.8 KB
/
posts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
<!DOCTYPE html>
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title>Shashank Pali - Posts</title><meta http-equiv='cache-control' content='no-cache' />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link id="wsite-base-style" rel="stylesheet" type="text/css" href="http://cdn2.editmysite.com/css/sites.css?buildTime=1234" />
<link rel="stylesheet" type="text/css" href="http://cdn2.editmysite.com/css/old/fancybox.css?1234" />
<link rel="stylesheet" type="text/css" href="http://cdn2.editmysite.com/css/social-icons.css?buildtime=1234" media="screen,projection" />
<link rel="stylesheet" type="text/css" href="files/main_style.css?1473771828" title="wsite-theme-css" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,700,400italic,700italic&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Raleway:400,300,200,700&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Karla:400,700,400italic,700italic&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Karla:400,700,400italic,700italic&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Karla:400,700,400italic,700italic&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Karla:400,700,400italic,700italic&subset=latin,latin-ext' rel='stylesheet' type='text/css' />
<style type='text/css'>
.wsite-elements.wsite-not-footer:not(.wsite-header-elements) div.paragraph, .wsite-elements.wsite-not-footer:not(.wsite-header-elements) p, .wsite-elements.wsite-not-footer:not(.wsite-header-elements) .product-block .product-title, .wsite-elements.wsite-not-footer:not(.wsite-header-elements) .product-description, .wsite-elements.wsite-not-footer:not(.wsite-header-elements) .wsite-form-field label, .wsite-elements.wsite-not-footer:not(.wsite-header-elements) .wsite-form-field label, #wsite-content div.paragraph, #wsite-content p, #wsite-content .product-block .product-title, #wsite-content .product-description, #wsite-content .wsite-form-field label, #wsite-content .wsite-form-field label, .blog-sidebar div.paragraph, .blog-sidebar p, .blog-sidebar .wsite-form-field label, .blog-sidebar .wsite-form-field label {font-family:"Karla" !important;}
#wsite-content div.paragraph, #wsite-content p, #wsite-content .product-block .product-title, #wsite-content .product-description, #wsite-content .wsite-form-field label, #wsite-content .wsite-form-field label, .blog-sidebar div.paragraph, .blog-sidebar p, .blog-sidebar .wsite-form-field label, .blog-sidebar .wsite-form-field label {}
.wsite-elements.wsite-footer div.paragraph, .wsite-elements.wsite-footer p, .wsite-elements.wsite-footer .product-block .product-title, .wsite-elements.wsite-footer .product-description, .wsite-elements.wsite-footer .wsite-form-field label, .wsite-elements.wsite-footer .wsite-form-field label{}
.wsite-elements.wsite-not-footer:not(.wsite-header-elements) h2, .wsite-elements.wsite-not-footer:not(.wsite-header-elements) .product-long .product-title, .wsite-elements.wsite-not-footer:not(.wsite-header-elements) .product-large .product-title, .wsite-elements.wsite-not-footer:not(.wsite-header-elements) .product-small .product-title, #wsite-content h2, #wsite-content .product-long .product-title, #wsite-content .product-large .product-title, #wsite-content .product-small .product-title, .blog-sidebar h2 {font-family:"Karla" !important;font-weight:700 !important;}
#wsite-content h2, #wsite-content .product-long .product-title, #wsite-content .product-large .product-title, #wsite-content .product-small .product-title, .blog-sidebar h2 {}
.wsite-elements.wsite-footer h2, .wsite-elements.wsite-footer .product-long .product-title, .wsite-elements.wsite-footer .product-large .product-title, .wsite-elements.wsite-footer .product-small .product-title{}
#wsite-title {font-family:"Karla" !important;}
.wsite-menu-default a {font-family:"Karla" !important;font-weight:700 !important;}
.wsite-menu a {}
.wsite-image div, .wsite-caption {}
.galleryCaptionInnerText {}
.fancybox-title {}
.wslide-caption-text {}
.wsite-phone {}
.wsite-headline,.wsite-header-section .wsite-content-title {}
.wsite-headline-paragraph,.wsite-header-section .paragraph {}
.wsite-button-inner {}
.wsite-not-footer blockquote {}
.wsite-footer blockquote {}
.blog-header h2 a {}
#wsite-content h2.wsite-product-title {}
.wsite-product .wsite-product-price a {}
</style>
<style>
.wsite-background {background-image: url("/uploads/8/6/0/3/86033258/background-images/1988676363.jpg") !important;background-repeat: no-repeat !important;background-position: 50% 50% !important;background-size: 100% !important;background-color: transparent !important;background: inherit;}
body.wsite-background {background-attachment: fixed !important;}.wsite-background.wsite-custom-background{ background-size: cover !important}
</style>
<script><!--
var STATIC_BASE = '//cdn1.editmysite.com/';
var ASSETS_BASE = '//cdn2.editmysite.com/';
var STYLE_PREFIX = 'wsite';
//-->
</script>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script>
<script type="text/javascript" src="http://cdn2.editmysite.com/js/lang/en/stl.js?buildTime=1234&"></script>
<script src="http://cdn2.editmysite.com/js/site/main.js?buildTime=1234"></script><script type="text/javascript">_W.configDomain = "www.weebly.com";</script><script>_W.relinquish && _W.relinquish()</script>
<script type="text/javascript" src="http://cdn2.editmysite.com/js/lang/en/stl.js?buildTime=1234&"></script><script> _W.themePlugins = [];</script><script type="text/javascript"><!--
var IS_ARCHIVE = 1;
(function(jQuery){
function initFlyouts(){
initPublishedFlyoutMenus(
[{"id":"331140052855482661","title":"Profile","url":"index.html","target":"","nav_menu":false,"nonclickable":false},{"id":"114828876524770445","title":"Blog","url":"blog.html","target":"","nav_menu":false,"nonclickable":false},{"id":"656599715744653041","title":"About","url":"about.html","target":"","nav_menu":false,"nonclickable":false},{"id":"466654237413753849","title":"Contact","url":"contact.html","target":"","nav_menu":false,"nonclickable":false}],
"811810673333736761",
'',
'active',
false,
{"navigation\/item":"<li {{#id}}id=\"{{id}}\"{{\/id}} class=\"wsite-menu-item-wrap\">\n\t<a\n\t\t{{^nonclickable}}\n\t\t\t{{^nav_menu}}\n\t\t\t\thref=\"{{url}}\"\n\t\t\t{{\/nav_menu}}\n\t\t{{\/nonclickable}}\n\t\t{{#target}}\n\t\t\ttarget=\"{{target}}\"\n\t\t{{\/target}}\n\t\t{{#membership_required}}\n\t\t\tdata-membership-required=\"{{.}}\"\n\t\t{{\/membership_required}}\n\t\tclass=\"wsite-menu-item\"\n\t\t>\n\t\t{{{title_html}}}\n\t<\/a>\n\t{{#has_children}}{{> navigation\/flyout\/list}}{{\/has_children}}\n<\/li>\n","navigation\/flyout\/list":"<div class=\"wsite-menu-wrap\" style=\"display:none\">\n\t<ul class=\"wsite-menu\">\n\t\t{{#children}}{{> navigation\/flyout\/item}}{{\/children}}\n\t<\/ul>\n<\/div>\n","navigation\/flyout\/item":"<li {{#id}}id=\"{{id}}\"{{\/id}}\n\tclass=\"wsite-menu-subitem-wrap {{#is_current}}wsite-nav-current{{\/is_current}}\"\n\t>\n\t<a\n\t\t{{^nonclickable}}\n\t\t\t{{^nav_menu}}\n\t\t\t\thref=\"{{url}}\"\n\t\t\t{{\/nav_menu}}\n\t\t{{\/nonclickable}}\n\t\t{{#target}}\n\t\t\ttarget=\"{{target}}\"\n\t\t{{\/target}}\n\t\tclass=\"wsite-menu-subitem\"\n\t\t>\n\t\t<span class=\"wsite-menu-title\">\n\t\t\t{{{title_html}}}\n\t\t<\/span>{{#has_children}}<span class=\"wsite-menu-arrow\">><\/span>{{\/has_children}}\n\t<\/a>\n\t{{#has_children}}{{> navigation\/flyout\/list}}{{\/has_children}}\n<\/li>\n"},
{}
)
}
if (jQuery) {
jQuery(document).ready(function() { jQuery(initFlyouts); });
}else{
if (Prototype.Browser.IE) window.onload = initFlyouts;
else document.observe('dom:loaded', initFlyouts);
}
})(window._W && _W.jQuery)
//-->
</script>
</head>
<body class="header-page page-has-banner wsite-theme-light wsite-page-posts wsite-blog-index"><div class="wrapper">
<div class="birdseye-header">
<div class="nav-wrap">
<div class="container">
<div class="logo"><span class="wsite-logo">
<a href="">
<span id="wsite-title">Shashank Pali</span>
</a>
</span></div>
<div class="nav desktop-nav"><ul class="wsite-menu-default">
<li id="pg331140052855482661" class="wsite-menu-item-wrap">
<a
href="index.html"
class="wsite-menu-item"
>
Profile
</a>
</li>
<li id="pg114828876524770445" class="wsite-menu-item-wrap">
<a
href="blog.html"
class="wsite-menu-item"
>
Blog
</a>
</li>
<li id="pg656599715744653041" class="wsite-menu-item-wrap">
<a
href="about.html"
class="wsite-menu-item"
>
About
</a>
</li>
<li id="pg466654237413753849" class="wsite-menu-item-wrap">
<a
href="contact.html"
class="wsite-menu-item"
>
Contact
</a>
</li>
</ul>
</div>
<label class="hamburger"><span></span></label>
</div>
</div>
</div>
<div class="banner-wrap">
<div class="wsite-elements wsite-not-footer wsite-header-elements">
<div class="wsite-section-wrap">
<div class="wsite-section wsite-header-section wsite-section-bg-image" style="height: 450px;vertical-align: middle;background-image: url("/uploads/8/6/0/3/86033258/background-images/1988676363.jpg") ;background-repeat: no-repeat ;background-position: 50% 50% ;background-size: 100% ;background-color: transparent ;background-size: cover" >
<div class="wsite-section-content">
<div class="container">
<div class="banner">
<h2 class="wsite-content-title"><font size="6">Xcode</font><br /><font size="6">"Magic of Logic"</font></h2>
</div>
</div>
</div>
<div class=""></div>
</div>
</div>
</div>
</div>
<div class="main-wrap">
<div class="wsite-elements wsite-not-footer">
<table
id="blogTable"
class="wsite-not-footer"
style="border: 0; width: 100%; table-layout: fixed"
>
<tr>
<td valign="top">
<div id="811810673333736761-blog" class="blog-body" style="float: left;">
<div id="wsite-content"> <div id="blog-post-252803961946612122" class="blog-post">
<div class="blog-header">
<h2 class="blog-title">
<a class="blog-title-link blog-link" href="http://UNSET/posts/pick-color-for-anywhere-in-uiimage">Pick color for anywhere in "UIImage"</a>
</h2>
<p class="blog-date">
<span class="date-text">
11/8/2016
</span>
</p>
<p class="blog-comments">
<a href="http://UNSET/posts/pick-color-for-anywhere-in-uiimage#comments" class="blog-link">
0 Comments
</a>
</p>
</div>
<div class="blog-separator"> </div>
<div class="blog-content">
<div class="paragraph">
<font size="3">The following code will give you the color from desire point just pass the parameters</font><br>
</div>
<div>
<div id="689044525375760906" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml">
<!-- HTML generated using hilite.me -->
<div style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .1em;padding:.5em .5em;">
<pre style="margin: 0; line-height: 125%">
<span style="color: #888888">/**</span>
<span style="color: #888888"> * Method use to get color at point in image</span>
<span style="color: #888888"> *</span>
<span style="color: #888888"> * @param point Desire point</span>
<span style="color: #888888"> * @param image Image in which color to be pick</span>
<span style="color: #888888"> *</span>
<span style="color: #888888"> * @return UIColor</span>
<span style="color: #888888"> */</span>
<span style="color: #008800; font-weight: bold">-</span> (UIColor <span style="color: #333333">*</span>)<span style="color: #0066BB; font-weight: bold">colorAtPoint:</span>(CGPoint)<span style="color: #996633">point</span> <span style="color: #0066BB; font-weight: bold">inImage:</span>(UIImage <span style="color: #333333">*</span>)<span style="color: #996633">image</span>
{
<span style="color: #008800; font-weight: bold">if</span> (<span style="color: #333333">!</span>CGRectContainsPoint(CGRectMake(<span style="color: #6600EE; font-weight: bold">0.0f</span>, <span style="color: #6600EE; font-weight: bold">0.0f</span>, image.size.width, image.size.height), point))
{
<span style="color: #008800; font-weight: bold">return</span> <span style="color: #007020">nil</span>;
}
<span style="color: #888888">// Create a 1x1 pixel byte array and bitmap context to draw the pixel into.</span>
NSInteger pointX <span style="color: #333333">=</span> trunc(point.x);
NSInteger pointY <span style="color: #333333">=</span> trunc(point.y);
CGImageRef cgImage <span style="color: #333333">=</span> image.CGImage;
NSUInteger width <span style="color: #333333">=</span> image.size.width;
NSUInteger height <span style="color: #333333">=</span> image.size.height;
CGColorSpaceRef colorSpace <span style="color: #333333">=</span> CGColorSpaceCreateDeviceRGB();
<span style="color: #333399; font-weight: bold">int</span> bytesPerPixel <span style="color: #333333">=</span> <span style="color: #0000DD; font-weight: bold">4</span>;
<span style="color: #333399; font-weight: bold">int</span> bytesPerRow <span style="color: #333333">=</span> bytesPerPixel <span style="color: #333333">*</span> <span style="color: #0000DD; font-weight: bold">1</span>;
NSUInteger bitsPerComponent <span style="color: #333333">=</span> <span style="color: #0000DD; font-weight: bold">8</span>;
<span style="color: #333399; font-weight: bold">unsigned</span> <span style="color: #333399; font-weight: bold">char</span> pixelData[<span style="color: #0000DD; font-weight: bold">4</span>] <span style="color: #333333">=</span> { <span style="color: #0000DD; font-weight: bold">0</span>, <span style="color: #0000DD; font-weight: bold">0</span>, <span style="color: #0000DD; font-weight: bold">0</span>, <span style="color: #0000DD; font-weight: bold">0</span> };
CGContextRef context <span style="color: #333333">=</span> CGBitmapContextCreate(pixelData, <span style="color: #0000DD; font-weight: bold">1</span>, <span style="color: #0000DD; font-weight: bold">1</span>, bitsPerComponent, bytesPerRow, colorSpace, kCGImageAlphaPremultipliedLast <span style="color: #333333">|</span> kCGBitmapByteOrder32Big);
CGColorSpaceRelease(colorSpace);
CGContextSetBlendMode(context, kCGBlendModeCopy);
<span style="color: #888888">// Draw the pixel we are interested in onto the bitmap context</span>
CGContextTranslateCTM(context, <span style="color: #333333">-</span>pointX, pointY<span style="color: #333333">-</span>(CGFloat)height);
CGContextDrawImage(context, CGRectMake(<span style="color: #6600EE; font-weight: bold">0.0f</span>, <span style="color: #6600EE; font-weight: bold">0.0f</span>, (CGFloat)width, (CGFloat)height), cgImage);
CGContextRelease(context);
<span style="color: #888888">// Convert color values [0..255] to floats [0.0..1.0]</span>
CGFloat red <span style="color: #333333">=</span> (CGFloat)pixelData[<span style="color: #0000DD; font-weight: bold">0</span>] <span style="color: #333333">/</span> <span style="color: #6600EE; font-weight: bold">255.0f</span>;
CGFloat green <span style="color: #333333">=</span> (CGFloat)pixelData[<span style="color: #0000DD; font-weight: bold">1</span>] <span style="color: #333333">/</span> <span style="color: #6600EE; font-weight: bold">255.0f</span>;
CGFloat blue <span style="color: #333333">=</span> (CGFloat)pixelData[<span style="color: #0000DD; font-weight: bold">2</span>] <span style="color: #333333">/</span> <span style="color: #6600EE; font-weight: bold">255.0f</span>;
CGFloat alpha <span style="color: #333333">=</span> (CGFloat)pixelData[<span style="color: #0000DD; font-weight: bold">3</span>] <span style="color: #333333">/</span> <span style="color: #6600EE; font-weight: bold">255.0f</span>;
UIColor <span style="color: #333333">*</span>color <span style="color: #333333">=</span> [UIColor colorWithRed<span style="color: #333333">:</span>red green<span style="color: #333333">:</span>green blue<span style="color: #333333">:</span>blue alpha<span style="color: #333333">:</span>alpha];
<span style="color: #008800; font-weight: bold">return</span> color;
}
</pre>
</div>
</div>
</div>
</div>
<div class="blog-social ">
<div class="blog-social-item blog-fb-like"><fb:like href="http://UNSET/1/post/2016/08/pick-color-for-anywhere-in-uiimage.html" width="90" layout="button_count" action="like" show_faces="false" share="false"></fb:like></div><div class="blog-social-item"><a class="twitter-share-button" href="http://twitter.com/share?url=http://UNSET/1/post/2016/08/pick-color-for-anywhere-in-uiimage.html" data-text="Pick color for anywhere in "UIImage" - Shashank Pali" data-count="horizontal"></a></div>
<div style="clear:both"></div>
</div>
<div class="blog-comments-bottom">
<a href="http://UNSET/posts/pick-color-for-anywhere-in-uiimage#comments" class="blog-link">
0 Comments
</a>
</div>
<div class="blog-post-separator"></div>
</div>
<div class="blog-page-nav-previous">
<a href="posts/previous/2" class="blog-link"><<Previous</a>
</div>
<!-- bid: $blog_id --></div>
</div>
</td>
<td class="blog-sidebar" valign="top">
<div id="811810673333736761-sidebar" class="column-blog">
<div class="blog-sidebar-separator">
<ul id="811810673333736761-sidebar-list" class="columnlist-blog" style="margin:0; padding: 0;">
<h2 class="blog-archives-title">Archives</h2>
<p class="blog-archive-list">
<a href="posts/archives/08-2016" class="blog-link">August 2016</a>
<br />
</p>
</ul>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="footer-wrap">
<div class="container">
<div class="footer">Create a <a target="_top" href="http://www.weebly.com/">free web site</a> with <a target="_top" href="http://www.weebly.com/" title="free web site">Weebly</a></div>
</div><!-- end container -->
</div><!-- end footer-wrap -->
</div><!-- /.wrapper -->
<div id="navMobile" class="nav mobile-nav">
<label class="hamburger"><span></span></label>
<ul class="wsite-menu-default">
<li id="pg331140052855482661" class="wsite-menu-item-wrap">
<a
href="index.html"
class="wsite-menu-item"
>
Profile
</a>
</li>
<li id="pg114828876524770445" class="wsite-menu-item-wrap">
<a
href="blog.html"
class="wsite-menu-item"
>
Blog
</a>
</li>
<li id="pg656599715744653041" class="wsite-menu-item-wrap">
<a
href="about.html"
class="wsite-menu-item"
>
About
</a>
</li>
<li id="pg466654237413753849" class="wsite-menu-item-wrap">
<a
href="contact.html"
class="wsite-menu-item"
>
Contact
</a>
</li>
</ul>
</div>
<script type="text/javascript" src="files/theme/plugins.js"></script>
<script type="text/javascript" src="files/theme/custom.js"></script>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '190291501407',
xfbml : true,
version : 'v2.6'
});
// Set Facebook comment plugin's colorscheme based off of theme
var comments = document.getElementsByClassName('facebook-comment-widget'),
scheme = document.body.className.match('wsite-theme-light');
for (var i = 0; i < comments.length; i++) {
comments[i].setAttribute('colorscheme', scheme ? 'light' : 'dark');
}
var fbCommentCounts;
FB.Event.subscribe('xfbml.render', function(){
fbCommentCounts = jQuery('.fb_comments_count');
for (var i = 0; i < fbCommentCounts.length; i++) {
var commentText = (jQuery(fbCommentCounts[i]).text() == '1' ? "Comment" : "Comments");
jQuery(fbCommentCounts[i]).parent().siblings('.fb_comment_count_label').text(commentText);
}
});
var comment_callback = function(res) {
FB.XFBML.parse(); // Refresh comment counters on page
}
FB.Event.subscribe('comment.create', comment_callback);
FB.Event.subscribe('comment.remove', comment_callback);
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/"+_W.facebookLocale+"/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<script type='text/javascript'>
(function() {
function j(src, id) {
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = src;
if(id) {s.id=id};
document.getElementsByTagName('head')[0].appendChild(s);
}
j('//platform.twi'+'tter.com/widgets.js');
})()
</script>
</body>
</html>