调用如下:

  1. Bitmap bitmap = new Bitmap("C:\\Users\\Thinkpad\\Desktop\\aa.jpg");
  2. Bitmap[] bit = new Bitmap[13];
  3. for (int i = 0; i < 13; i++) {
  4. bit[i] = new Bitmap("C:\\Users\\Thinkpad\\Desktop\\aa.jpg");
  5. }
  6. //去色
  7. pictureEdit1.Image = ImagePS.DeColor(bit[0]);
  8. //去色 去掉白色
  9. pictureEdit2.Image = ImagePS.DeColor(bit[1], Color.White);
  10. //底片
  11. pictureEdit3.Image = ImagePS.ReImg(bit[2]);
  12. //浮雕
  13. pictureEdit4.Image = ImagePS.Raised(bit[3]);
  14. //高斯模糊
  15. pictureEdit5.Image = ImagePS.Softness(bit[4]);
  16. //锐化
  17. pictureEdit6.Image = ImagePS.Definition(bit[5]);
  18. //色相
  19. pictureEdit7.Image = ImagePS.SetColorFilter(bit[6], ImagePS.ColorFilterType.Red);
  20. //对比度
  21. pictureEdit8.Image = ImagePS.Contrast(bit[7], 50);
  22. //缩放
  23. pictureEdit9.Image = ImagePS.KiResizeImage(bit[8], 100, 100);
  24. //亮度调整
  25. pictureEdit10.Image = ImagePS.LightImage(bit[9], -100);
  26. //设置曲线
  27. pictureEdit11.Image = ImagePS.SetGamma(bit[10],250,100,250);
  28. //得到纯色图片
  29. pictureEdit12.Image = ImagePS.GetColorImg(Color.Yellow,100,100);
  1. <strong><span style="font-size:14px;">底层类:</span></strong>
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using System.Drawing;
  5. using System.Drawing.Imaging;
  6. using System.Drawing.Drawing2D;
  7. using System.Windows.Forms;
  8. namespace Common
  9. {
  10. /// <summary>
  11. /// 图片处理 基础类
  12. /// </summary>
  13. public class ImagePS
  14. {
  15. public static Bitmap GetControlBmp(Control ctrl, int offsetX, int offsetY)
  16. {
  17. Graphics myGraphics = ctrl.CreateGraphics();
  18. Rectangle r = ctrl.RectangleToScreen(ctrl.Bounds);
  19. Bitmap memoryImage = new Bitmap(r.Width, r.Height, myGraphics);
  20. Graphics memoryGraphics = Graphics.FromImage(memoryImage);
  21. memoryGraphics.CopyFromScreen(r.X - offsetX, r.Y - offsetY, 0, 0, new Size(r.Width, r.Height));
  22. return memoryImage;
  23. }
  24. /// <summary>
  25. /// 色相类型,红,绿,蓝
  26. /// </summary>
  27. public enum ColorFilterType
  28. {
  29. Red, Green, Blue
  30. }
  31. /// <summary>
  32. /// 底片效果
  33. /// </summary>
  34. /// <param name="img">图片</param>
  35. /// <returns>处理后的图片</returns>
  36. public static Bitmap ReImg(Bitmap img)
  37. {
  38. byte r, g, b;
  39. for (int i = 0; i < img.Width; i++)
  40. {
  41. for (int j = 0; j < img.Height; j++)
  42. {
  43. r = (byte)(255 - img.GetPixel(i, j).R);
  44. g = (byte)(255 - img.GetPixel(i, j).G);
  45. b = (byte)(255 - img.GetPixel(i, j).B);
  46. img.SetPixel(i, j, Color.FromArgb(r, g, b));
  47. }
  48. }
  49. return img;
  50. }
  51. /// <summary>
  52. /// 图片亮度调整
  53. /// </summary>
  54. /// <param name="bitmap">图片</param>
  55. /// <param name="light">亮度[-255,255]</param>
  56. /// <returns>处理后的图片</returns>
  57. public static Bitmap LightImage(Bitmap bitmap, int light)
  58. {
  59. light = light > 255 ? 255 : light;
  60. light = light < -255 ? -255 : light;
  61. int w = bitmap.Width;
  62. int h = bitmap.Height;
  63. int pix = 0;
  64. BitmapData data = bitmap.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
  65. unsafe
  66. {
  67. byte* p = (byte*)data.Scan0;
  68. int offset = data.Stride - w * 3;
  69. for (int i = 0; i < w; i++)
  70. {
  71. for (int j = 0; j < h; j++)
  72. {
  73. for (int x = 0; x < 3; x++)
  74. {
  75. pix = p[x] + light;
  76. if (light < 0)
  77. p[x] = (byte)Math.Max(0, pix);
  78. if (light > 0)
  79. p[x] = (byte)Math.Min(255, pix);
  80. }
  81. p += 3;
  82. }
  83. p += offset;
  84. }
  85. }
  86. bitmap.UnlockBits(data);
  87. return bitmap;
  88. }
  89. /// <summary>
  90. /// 图片去色
  91. /// </summary>
  92. /// <param name="img">要去色的图片</param>
  93. /// <returns>处理后的图片</returns>
  94. public static Bitmap DeColor(Bitmap img)
  95. {
  96. if (img == null)
  97. return img;
  98. int w = img.Width, h = img.Height;
  99. Color oldColor, newColor;
  100. int y = 0;
  101. for (int i = 0; i < w; i++)
  102. {
  103. for (int j = 0; j < h; j++)
  104. {
  105. oldColor = img.GetPixel(i, j);
  106. byte r = oldColor.R;
  107. byte g = oldColor.G;
  108. byte b = oldColor.B;
  109. y = (r + g + b) / 3;
  110. newColor = Color.FromArgb(y, y, y);
  111. img.SetPixel(i, j, newColor);
  112. }
  113. }
  114. return img;
  115. }
  116. /// <summary>
  117. /// 图片去色
  118. /// </summary>
  119. /// <param name="img">要去色的图片</param>
  120. /// <param name="c">要去掉的颜色</param>
  121. /// <returns>处理后的图片</returns>
  122. public static Bitmap DeColor(Bitmap img, Color c)
  123. {
  124. int w = img.Width, h = img.Height;
  125. Color oldColor;
  126. int cha1 = 60;
  127. int cha2 = 60;
  128. for (int i = 0; i < w; i++)
  129. {
  130. for (int j = 0; j < h; j++)
  131. {
  132. oldColor = img.GetPixel(i, j);
  133. byte r = oldColor.R;
  134. byte g = oldColor.G;
  135. byte b = oldColor.B;
  136. bool bol1 = false, bol2 = false, bol3 = false;
  137. if (r - c.R < cha1 && r - c.R > -cha2)
  138. bol1 = true;
  139. if (g - c.G < cha1 && g - c.G > -cha2)
  140. bol2 = true;
  141. if (b - c.B < cha1 && b - c.B > -cha2)
  142. bol3 = true;
  143. if (bol1 && bol2 && bol3)
  144. {
  145. //y = (r + g + b) / 3;
  146. //newColor = Color.FromArgb(y, y, y);
  147. img.SetPixel(i, j, Color.Black);
  148. }
  149. }
  150. }
  151. return img;
  152. }
  153. /// <summary>
  154. /// 浮雕效果
  155. /// </summary>
  156. /// <param name="img">要处理的图片</param>
  157. /// <returns>处理后的图片</returns>
  158. public static Bitmap Raised(Bitmap img)
  159. {
  160. Color pix1, pix2;
  161. for (int x = 0; x < img.Width - 1; x++)
  162. {
  163. for (int y = 0; y < img.Height - 1; y++)
  164. {
  165. pix1 = img.GetPixel(x, y);
  166. pix2 = img.GetPixel(x + 1, y + 1);
  167. int r = 0, g = 0, b = 0;//新颜色的R,G,B
  168. r = Math.Abs(pix1.R - pix2.R + 100);
  169. g = Math.Abs(pix1.G - pix2.G + 100);
  170. b = Math.Abs(pix1.B - pix2.B + 100);
  171. //控制上下限 0 -- 255
  172. r = Math.Min(255, r);
  173. g = Math.Min(255, g);
  174. b = Math.Min(255, b);
  175. r = Math.Max(0, r);
  176. g = Math.Max(0, g);
  177. b = Math.Max(0, b);
  178. img.SetPixel(x, y, Color.FromArgb(r, g, b));
  179. }
  180. }
  181. return img;
  182. }
  183. /// <summary>
  184. /// 高斯模糊
  185. /// </summary>
  186. /// <param name="img">要处理的图片</param>
  187. /// <returns>处理后的图片</returns>
  188. public static Bitmap Softness(Bitmap img)
  189. {
  190. Color pixel;
  191. int Width = img.Width;
  192. int Height = img.Height;
  193. int[] Gauss = { 1, 2, 1, 2, 4, 2, 1, 2, 1 };
  194. for (int x = 1; x < Width - 1; x++)
  195. {
  196. for (int y = 1; y < Height - 1; y++)
  197. {
  198. int r = 0, g = 0, b = 0;
  199. int Index = 0;
  200. for (int col = -1; col <= 1; col++)
  201. {
  202. for (int row = -1; row <= 1; row++)
  203. {
  204. pixel = img.GetPixel(x + row, y + col);
  205. r += pixel.R * Gauss[Index];
  206. g += pixel.G * Gauss[Index];
  207. b += pixel.B * Gauss[Index];
  208. Index++;
  209. }
  210. }
  211. r /= 16;
  212. g /= 16;
  213. b /= 16;
  214. //处理颜色值溢出
  215. r = r > 255 ? 255 : r;
  216. r = r < 0 ? 0 : r;
  217. g = g > 255 ? 255 : g;
  218. g = g < 0 ? 0 : g;
  219. b = b > 255 ? 255 : b;
  220. b = b < 0 ? 0 : b;
  221. img.SetPixel(x - 1, y - 1, Color.FromArgb(r, g, b));
  222. }
  223. }
  224. return img;
  225. }
  226. /// <summary>
  227. /// 对比度
  228. /// </summary>
  229. /// <param name="img">要处理的图片</param>
  230. /// <param name="m">对比度[-100,100]</param>
  231. /// <returns>处理后的图片</returns>
  232. public static Bitmap Contrast(Bitmap img, int m)
  233. {
  234. if (m < -100) m = -100;
  235. if (m > 100) m = 100;
  236. //Width, Height
  237. int w = img.Width;
  238. int h = img.Height;
  239. double pix = 0;
  240. BitmapData data = img.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
  241. int offset = data.Stride - 3 * w;
  242. double contrast = (100.00 + m) / 100.00;
  243. contrast *= contrast;
  244. unsafe
  245. {
  246. byte* p = (byte*)data.Scan0;
  247. for (int i = 0; i < w; i++)
  248. {
  249. for (int j = 0; j < h; j++)
  250. {
  251. for (int y = 0; y < 3; y++)
  252. {
  253. pix = ((p[y] / 255.00 - 0.5) * contrast + 0.5) * 255;
  254. if (pix < 0) pix = 0;
  255. if (pix > 255) pix = 255;
  256. p[y] = (byte)pix;
  257. }
  258. p += 3;
  259. }
  260. p += offset;
  261. }
  262. }
  263. img.UnlockBits(data);
  264. return img;
  265. }
  266. /// <summary>
  267. /// 锐化
  268. /// </summary>
  269. /// <param name="img">要处理的图片</param>
  270. /// <returns>处理后的图片</returns>
  271. public static Bitmap Definition(Bitmap img)
  272. {
  273. int w = img.Width;
  274. int h = img.Height;
  275. Color c;
  276. int[] laplacian = { -1, -1, -1, -1, 9, -1, -1, -1, -1 };
  277. for (int i = 1; i < w - 1; i++)
  278. {
  279. for (int j = 1; j < h - 1; j++)
  280. {
  281. int r = 0, g = 0, b = 0;
  282. int index = 0;
  283. for (int col = -1; col <= 1; col++)
  284. {
  285. for (int row = -1; row <= 1; row++)
  286. {
  287. c = img.GetPixel(i + row, j + col);
  288. r += c.R * laplacian[index];
  289. g += c.G * laplacian[index];
  290. b += c.B * laplacian[index];
  291. index += 1;
  292. }
  293. }
  294. r = Math.Max(0, r);
  295. r = Math.Min(255, r);
  296. g = Math.Max(0, g);
  297. g = Math.Min(255, g);
  298. b = Math.Max(0, b);
  299. b = Math.Min(255, b);
  300. img.SetPixel(i - 1, j - 1, Color.FromArgb(r, g, b));
  301. }//end for
  302. }//end for
  303. return img;
  304. }
  305. /// <summary>
  306. /// 雾化
  307. /// </summary>
  308. /// <param name="img">要处理的图片</param>
  309. /// <returns>处理后的图片</returns>
  310. public static Bitmap Atomization(Bitmap img)
  311. {
  312. int w = img.Width;
  313. int h = img.Height;
  314. Color pix;
  315. //在此实例化,雾化效果
  316. Random ran = new Random();
  317. for (int x = 0; x < w; x++)
  318. {
  319. for (int y = 0; y < h; y++)
  320. {
  321. //Random ran = new Random(); 在此实例化,水一样的效果
  322. int dx = x + ran.Next(1234567) % 17;
  323. int dy = y + ran.Next(1234567) % 17;
  324. pix = img.GetPixel(Math.Min(dx, w - 1), Math.Min(dy, h - 1));
  325. img.SetPixel(x, y, pix);
  326. }
  327. }
  328. return img;
  329. }
  330. /// <summary>
  331. /// 设置色相
  332. /// </summary>
  333. /// <param name="img">要处理的图片</param>
  334. /// <param name="cType">色相</param>
  335. /// <returns>处理后的图片</returns>
  336. public static Bitmap SetColorFilter(Bitmap img, ColorFilterType cType)
  337. {
  338. Color c;
  339. int r = 0, g = 0, b = 0;
  340. for (int x = 0; x < img.Width; x++)
  341. {
  342. for (int y = 0; y < img.Height; y++)
  343. {
  344. c = img.GetPixel(x, y);
  345. r = c.R;
  346. g = c.G;
  347. b = c.B;
  348. if (cType == ColorFilterType.Red)
  349. {
  350. g -= 255;
  351. b -= 255;
  352. }
  353. else if (cType == ColorFilterType.Green)
  354. {
  355. r -= 255;
  356. b -= 255;
  357. }
  358. else
  359. {
  360. r -= 255;
  361. g -= 255;
  362. }
  363. //控制色值大小 0 -- 255
  364. r = Math.Max(0, r);
  365. g = Math.Max(0, g);
  366. b = Math.Max(0, b);
  367. r = Math.Min(255, r);
  368. g = Math.Min(255, g);
  369. b = Math.Min(255, b);
  370. img.SetPixel(x, y, Color.FromArgb(r, g, b));
  371. }
  372. }
  373. return img;
  374. }
  375. /// <summary>
  376. /// 曲线
  377. /// </summary>
  378. /// <param name="img">要处理的图片</param>
  379. /// <param name="red">红</param>
  380. /// <param name="green">绿</param>
  381. /// <param name="blue">蓝</param>
  382. /// <returns>处理后的图片</returns>
  383. public static Bitmap SetGamma(Bitmap img, byte red, byte green, byte blue)
  384. {
  385. Color c;
  386. byte[] reds = CreateGamma(red);
  387. byte[] greens = CreateGamma(green);
  388. byte[] blues = CreateGamma(blue);
  389. for (int x = 0; x < img.Width; x++)
  390. {
  391. for (int y = 0; y < img.Height; y++)
  392. {
  393. c = img.GetPixel(x, y);
  394. img.SetPixel(x, y, Color.FromArgb(reds[c.R], greens[c.G], blues[c.B]));
  395. }
  396. }
  397. return img;
  398. }
  399. //创建 曲线数组
  400. private static byte[] CreateGamma(byte color)
  401. {
  402. byte[] gammas = new byte[256];
  403. for (int i = 0; i < 256; i++)
  404. {
  405. gammas[i] = Math.Min((byte)255, (byte)(255.0F * Math.Pow(i / 255, 1.0F / color) + 0.5F));
  406. }
  407. return gammas;
  408. }
  409. /// <summary>
  410. /// 合并图片
  411. /// </summary>
  412. /// <param name="imgs">要处理的图片列表</param>
  413. /// <param name="z">图片间隔</param>
  414. /// <returns></returns>
  415. public static Bitmap MergerImg(List<Bitmap> imgs, int z)
  416. {
  417. if (imgs.Count <= 0)
  418. return null;
  419. int w = 0;
  420. foreach (Bitmap bmp in imgs)
  421. if (bmp != null)
  422. w = w + bmp.Width;
  423. w += z * (imgs.Count - 1);
  424. int h = GetMaxHeight(imgs);
  425. return MergerImg(imgs, z, w, h);
  426. }
  427. private static int GetMaxHeight(List<Bitmap> imgs)
  428. {
  429. if (imgs == null || imgs.Count == 0)
  430. return 0;
  431. int maxHeight = 0;
  432. foreach (Bitmap bmp in imgs)
  433. {
  434. if (bmp == null)
  435. continue;
  436. if (maxHeight == -1)
  437. {
  438. maxHeight = bmp.Height;
  439. }
  440. else
  441. maxHeight = bmp.Height > maxHeight ? bmp.Height : maxHeight;
  442. }
  443. return maxHeight;
  444. }
  445. private static int GetMinHeight(List<Bitmap> imgs)
  446. {
  447. if (imgs == null || imgs.Count == 0)
  448. return 0;
  449. int mixHeight = 0;
  450. foreach (Bitmap bmp in imgs)
  451. {
  452. if (mixHeight == 0)
  453. {
  454. mixHeight = bmp.Height;
  455. }
  456. else
  457. mixHeight = bmp.Height < mixHeight ? bmp.Height : mixHeight;
  458. }
  459. return mixHeight;
  460. }
  461. private static Bitmap MergerImg(List<Bitmap> imgs, int z, int w, int h)
  462. {
  463. //创建要显示的图片对象,根据参数的个数设置宽度
  464. Bitmap backgroudImg = new Bitmap(w, h);
  465. Graphics g = Graphics.FromImage(backgroudImg);
  466. //清除画布,背景设置为白色
  467. g.Clear(System.Drawing.Color.White);
  468. int x = 0;
  469. for (int i = 0; i < imgs.Count; i++)
  470. {
  471. Bitmap bmp = imgs[i];// KiResizeImage(imgs[i], imgs[i].Width, h);
  472. if (bmp == null)
  473. continue;
  474. g.DrawImage(bmp, x, 0, bmp.Width, h);
  475. x = x + bmp.Width + z;
  476. g.Flush();
  477. }
  478. g.Dispose();
  479. return backgroudImg;
  480. }
  481. /// <summary>
  482. /// 合并图片
  483. /// </summary>
  484. /// <param name="imgs">要处理的图片列表</param>
  485. /// <param name="z">图片间隔</param>
  486. /// <param name="mType">0按高度最高的合并 1 按高度最低的合并</param>
  487. /// <returns></returns>
  488. public static Bitmap MergerImg(List<Bitmap> imgs, int z, int mType)
  489. {
  490. if (imgs.Count <= 0)
  491. return null;
  492. int w = 0;
  493. foreach (Bitmap bmp in imgs)
  494. w += bmp.Width;
  495. w += z * (imgs.Count - 1);
  496. int h = mType == 0 ? GetMaxHeight(imgs) : GetMinHeight(imgs);
  497. return MergerImg(imgs, z, w, h);
  498. }
  499. /// <summary>
  500. /// 缩放
  501. /// </summary>
  502. /// <param name="bmp">要处理的图片</param>
  503. /// <param name="newW">缩放后的宽</param>
  504. /// <param name="newH">缩放后的高</param>
  505. /// <returns></returns>
  506. public static Bitmap KiResizeImage(Bitmap bmp, int newW, int newH)
  507. {
  508. if (bmp == null)
  509. return null;
  510. int max = bmp.Width > bmp.Height ? bmp.Width : bmp.Height;
  511. float l = max == bmp.Width ? (float)newW / (float)bmp.Width : (float)newH / (float)bmp.Height;
  512. float ww = bmp.Width * l;
  513. float hh = bmp.Height * l;
  514. ww = ww > 1 ? ww : newW;
  515. hh = hh > 1 ? hh : newH;
  516. Bitmap b = new Bitmap((int)ww, (int)hh);
  517. try
  518. {
  519. Graphics g = Graphics.FromImage(b);
  520. g.PixelOffsetMode = PixelOffsetMode.Half;
  521. // 插值算法的质量
  522. g.InterpolationMode = InterpolationMode.High;
  523. g.DrawImage(bmp, new Rectangle(0, 0, (int)ww, (int)hh),
  524. new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel);
  525. g.Dispose();
  526. }
  527. catch (Exception ex)
  528. {
  529. throw ex;
  530. }
  531. return b;
  532. }
  533. /// <summary>
  534. /// 图片包含的颜色数量
  535. /// </summary>
  536. /// <param name="img">图片</param>
  537. /// <returns></returns>
  538. public static List<Color> ColorNumber(Bitmap img)
  539. {
  540. int w = img.Width, h = img.Height;
  541. Color nowColor;
  542. //阀值
  543. int distance = 90;
  544. List<Color> colors = new List<Color>();
  545. for (int i = 0; i < w; i++)
  546. {
  547. for (int j = 0; j < h; j++)
  548. {
  549. nowColor = img.GetPixel(i, j);
  550. byte r = nowColor.R;
  551. byte g = nowColor.G;
  552. byte b = nowColor.B;
  553. if (colors.Count == 0)
  554. colors.Add(nowColor);
  555. else
  556. {
  557. int count = 0;
  558. foreach (Color c in colors)
  559. {
  560. byte or = c.R;
  561. byte og = c.G;
  562. byte ob = c.B;
  563. int R = System.Math.Abs(r - or);
  564. int G = System.Math.Abs(g - og);
  565. int B = System.Math.Abs(b - ob);
  566. double sqr = System.Math.Sqrt(R * R + G * G + B * B);
  567. if (sqr > distance)
  568. count += 1;
  569. }
  570. if (count >= colors.Count)
  571. colors.Add(nowColor);
  572. }
  573. }
  574. }
  575. return colors;
  576. }
  577. /// <summary>
  578. /// 颜色图片
  579. /// </summary>
  580. /// <param name="c">颜色</param>
  581. /// <param name="width">宽 像素</param>
  582. /// <param name="hight">高 像素</param>
  583. /// <returns></returns>
  584. public static Bitmap GetColorImg(Color c,int width,int height)
  585. {
  586. Bitmap bmp;
  587. if (width > 0 && height > 0)
  588. {
  589. bmp = new Bitmap(width, height);
  590. }
  591. else
  592. {
  593. bmp = new Bitmap(10, 10);
  594. }
  595. for (int i = 0; i < bmp.Width; i++)
  596. {
  597. for (int j = 0; j < bmp.Height; j++)
  598. {
  599. bmp.SetPixel(i, j, c);
  600. }
  601. }
  602. return bmp;
  603. }
  604. }
  605. }

图片处理类 类库--C#的更多相关文章

  1. 分享一下怎么开发一款图片视频类App,秒拍和prisma

    第一步,分解短视频App的功能 我们在秒拍官网看到如此描述: [视频拍摄及导入]支持直接拍摄及导入手机本地的视频 [照片电影]照片专属特效,轻松创作照片电影 [MV特效]10余款全新MV特效,让普通视 ...

  2. PHP编写的图片验证码类文件分享方法

    适用于自定义的验证码类! <?php/* * To change this license header, choose License Headers in Project Propertie ...

  3. Java图片工具类,完成图片的截取和任意缩放

    package com.common.util; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Renderin ...

  4. bootstrap-wysiwyg 结合 base64 解码 .net bbs 图片操作类

    using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Dr ...

  5. 拍照、本地图片工具类(兼容至Android7.0)

    拍照.本地图片工具类:解决了4.4以上剪裁会提示"找不到文件"和6.0动态授予权限,及7.0报FileUriExposedException异常问题. package com.hb ...

  6. Android--很实用的图片工具类

    import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileNotFoundException; imp ...

  7. PHP 图片缩放类

    <?php /** * 图片压缩类:通过缩放来压缩. * 如果要保持源图比例,把参数$percent保持为1即可. * 即使原比例压缩,也可大幅度缩小.数码相机4M图片.也可以缩为700KB左右 ...

  8. Android Handler 异步消息处理机制的妙用 创建强大的图片载入类

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/38476887 ,本文出自[张鸿洋的博客] 近期创建了一个群.方便大家交流,群号: ...

  9. Java_图片处理_02_图片处理工具类库

    二.参考文档 1.Java图片处理工具类库

随机推荐

  1. 转:TCP/IP协议(一)网络基础知识

    转载:http://www.cnblogs.com/imyalost/p/6086808.html 参考书籍为<图解tcp/ip>-第五版.这篇随笔,主要内容还是TCP/IP所必备的基础知 ...

  2. (4)Linux常用基本操作

    1.ping和traceroute 指定源IP ping:ping -I 源 目的    #I为大写的i 带源地址路由tracert:traceroute -d <目标地址> -s < ...

  3. c#: WebBrowser 禁止在新窗口打开链接

    项目中碰到此需求.几番比对,此为最好的解决方案,聊做备忘. 1.加入Microsoft Internet Controls引用: 项目右键->添加引用->COM->Microsoft ...

  4. 解析ReentrantLock实现原理

    在Java中通常实现锁有两种方式,一种是synchronized关键字,另一种是Lock(Lock的实现主要有ReentrantLock.ReadLock和WriteLock).synchronize ...

  5. gulp打包普通项目

    第一步:npm init 生成一个page.json第二步建立一个gulpfile.js文件主要是写这个文件 var gulp = require('gulp'), rev = require('gu ...

  6. 磁盘管理 lvm减容扩容

    参考https://blog.csdn.net/wk022/article/details/50543922 新增磁盘/dev/sdb fdisk /dev/sdb  分两个分区  (n p 1 /n ...

  7. angular2监听页面大小变化

    一.现象 全屏页面中的图表,在很多的时候需要 resize 一把,以适应页面的大小变化 二.解决 1.引入 : import { Observable } from 'rxjs'; 2.使用(在ngO ...

  8. Samtools在Linux上非root权限的安装

    第一次在Linux上不用root权限安装软件,查看了很多博客,并实践安装成功.大致总结了一下samtools的安装过程,仅供大家参考,如有不对的地方,欢迎指正~ samtools安装过程中依赖于lzm ...

  9. centos 安装nvm和node.js

    #安装githubyum install git -y #下载nvmgit clone git://github.com/creationix/nvm.git ~/nvm #设置nvm 自动运行;ec ...

  10. oracle service name sid , 用户 和 表空间

    oracle 的四个概念: 数据库: 就是一堆静态的数据文件.注意是静态的 instance 实例: 可以类比数据库连接. 实例就是为了操作数据库而开辟的进程和内存空间,有了这个实例你才能操作数据库. ...