{"id":5019,"date":"2020-08-24T19:00:07","date_gmt":"2020-08-24T19:00:07","guid":{"rendered":"http:\/\/crypt3r.ir\/wp\/?p=5019"},"modified":"2020-08-24T19:13:04","modified_gmt":"2020-08-24T19:13:04","slug":"%da%af%d8%b1%d8%af-%da%a9%d8%b1%d8%af%d9%86-%d8%b9%da%a9%d8%b3-b4x","status":"publish","type":"post","link":"https:\/\/crypt3r.ir\/wp\/%da%af%d8%b1%d8%af-%da%a9%d8%b1%d8%af%d9%86-%d8%b9%da%a9%d8%b3-b4x\/","title":{"rendered":"\u06af\u0631\u062f \u06a9\u0631\u062f\u0646 \u0639\u06a9\u0633 [B4X]"},"content":{"rendered":"<p>\u0633\u0644\u0627\u0645 \u0628\u0647 \u0647\u0645\u0647<\/p>\n<p>\u0647\u0645\u0648\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0627\u0632 \u0639\u0646\u0648\u0627\u0646 \u067e\u06cc\u062f\u0627\u0633\u062a\u060c \u0628\u0627 \u06a9\u062f \u0632\u06cc\u0631 \u0645\u06cc\u062a\u0648\u0646\u06cc\u062f \u0639\u06a9\u0633 \u0647\u0627 \u0631\u0648 \u06af\u0631\u062f \u06a9\u0646\u06cc\u062f. \u06a9\u062a\u0627\u0628\u062e\u0648\u0646\u0647 \u0647\u0627\u06cc \u0628\u0633\u06cc\u0627\u0631 \u0632\u06cc\u0627\u062f\u06cc \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0627\u0631 \u0631\u067e \u0634\u062f\u0647 \u06a9\u0647 \u062a\u0648 \u0647\u0645\u06cc\u0646 \u0633\u0627\u06cc\u062a \u0647\u0645 \u0645\u0648\u062c\u0648\u062f \u0647\u0633\u062a. \u0627\u0645\u0627 \u0686\u0648\u0646 \u06a9\u062f \u0632\u06cc\u0631\u060c \u062f\u0631 B4A \u0648 \u0647\u0645 \u062f\u0631 B4J \u0648 \u0647\u0645 \u062f\u0631 B4i \u0642\u0627\u0628\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0647\u0633\u062a\u060c \u0627\u06cc\u0646\u062c\u0627 \u0645\u06cc\u0630\u0627\u0631\u0645\u0634.(\u0628\u0647\u0645\u06cc\u0646 \u062e\u0627\u0637\u0631 \u0639\u0646\u0648\u0627\u0646 \u062a\u0627\u067e\u06cc\u06a9 \u0631\u0648 \u06af\u0630\u0627\u0634\u062a\u0645 B4X)<\/p>\n<p><!--more--><\/p>\n<p>\u0646\u062a\u06cc\u062c\u0647 \u0645\u06cc\u0634\u0647 \u06cc\u0647 \u0686\u06cc\u0632\u06cc \u0645\u062b\u0644 \u0627\u06cc\u0646:<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/crypt3r.ir\/wp\/wp-content\/uploads\/2020\/08\/SS-2017-10-17_12.59.56.png\" alt=\"SS-2017-10-17_12.59.56.png (311\u00d7311)\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u06a9\u062f:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">'xui is a global XUI variable.\r\nSub CreateRoundBitmap (Input As B4XBitmap, Size As Int) As B4XBitmap\r\n   If Input.Width &lt;&gt; Input.Height Then\r\n       'if the image is not square then we crop it to be a square.\r\n       Dim l As Int = Min(Input.Width, Input.Height)\r\n       Input = Input.Crop(Input.Width \/ 2 - l \/ 2, Input.Height \/ 2 - l \/ 2, l, l)\r\n   End If\r\n   Dim c As B4XCanvas\r\n   Dim xview As B4XView = xui.CreatePanel(\"\")\r\n   xview.SetLayoutAnimated(0, 0, 0, Size, Size)\r\n   c.Initialize(xview)\r\n   Dim path As B4XPath\r\n   path.InitializeOval(c.TargetRect)\r\n   c.ClipPath(path)\r\n   c.DrawBitmap(Input.Resize(Size, Size, False), c.TargetRect)\r\n   c.RemoveClip\r\n   c.DrawCircle(c.TargetRect.CenterX, c.TargetRect.CenterY, c.TargetRect.Width \/ 2 - 2dip, xui.Color_White, False, 5dip) 'comment this line to remove the border\r\n   c.Invalidate\r\n   Dim res As B4XBitmap = c.CreateBitmap\r\n   c.Release\r\n   Return res\r\nEnd Sub\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0646\u062d\u0648\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0634 \u0647\u0645 \u0628\u0647 \u0627\u06cc\u0646 \u0635\u0648\u0631\u062a\u0647 \u06a9\u0647 \u0627\u0648\u0644 \u0633\u0627\u0628 \u0628\u0627\u0644\u0627 \u0631\u0648 \u0628\u0647 \u0627\u06a9\u062a\u06cc\u0648\u06cc\u062a\u06cc \u0627\u0636\u0627\u0641 \u0645\u06cc\u06a9\u0646\u06cc\u062f \u0648 \u0647\u0631\u062c\u0627 \u06a9\u0647 \u062e\u0648\u0627\u0633\u062a\u06cc\u0646\u060c \u06a9\u062f\u0647\u0627\u06cc \u0632\u06cc\u0631 \u0631\u0648 \u0645\u06cc\u0646\u0648\u06cc\u0633\u06cc\u062f:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">Dim xui As XUI\r\nDim ImageView1 As B4XView\r\n\r\nDim img As B4XBitmap = xui.LoadBitmap(File.DirAssets, \"myimage.jpg\")\r\nImageView1.SetBitmap(CreateRoundBitmap(img, ImageView1.Width))\r\n\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0627\u06af\u0631 \u0646\u0645\u06cc\u062e\u0648\u0627\u06cc\u0646 \u06a9\u0647 ImageView1 \u0627\u0632 \u0646\u0648\u0639 B4XView \u0628\u0627\u0634\u0647\u060c \u0627\u0632 \u06a9\u062f \u0632\u06cc\u0631 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true\">Dim xui As XUI\r\nDim ImageView1 As ImageView\r\nDim img As B4XBitmap = xui.LoadBitmap(File.DirAssets, \"myimage.jpg\")\r\n\r\nDim xIV As B4XView = ImageView1\r\nxIV.SetBitmap(CreateRoundBitmap(img, xIV .Width))\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u0628\u0631\u0627\u06cc \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0628\u0627\u06cc\u062f \u06a9\u062a\u0627\u0628\u062e\u0648\u0646\u0647 XUI \u0631\u0648 \u0641\u0639\u0627\u0644 \u06a9\u0646\u06cc\u062f \u0648 \u06cc\u0647 \u0645\u062a\u063a\u06cc\u0631 \u0627\u0632 \u0627\u0648\u0646 \u0631\u0648 \u0628\u0647 \u0627\u0633\u0645 xui \u062f\u0631 Globals \u062a\u0639\u0631\u06cc\u0641 \u06a9\u0646\u06cc\u062f.<\/p>\n<p>\u0645\u0648\u0641\u0642 \u0628\u0627\u0634\u06cc\u062f<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0633\u0644\u0627\u0645 \u0628\u0647 \u0647\u0645\u0647 \u0647\u0645\u0648\u0646\u0637\u0648\u0631 \u06a9\u0647 \u0627\u0632 \u0639\u0646\u0648\u0627\u0646 \u067e\u06cc\u062f\u0627\u0633\u062a\u060c \u0628\u0627 \u06a9\u062f \u0632\u06cc\u0631 \u0645\u06cc\u062a\u0648\u0646\u06cc\u062f \u0639\u06a9\u0633 \u0647\u0627 \u0631\u0648 \u06af\u0631\u062f \u06a9\u0646\u06cc\u062f. \u06a9\u062a\u0627\u0628\u062e\u0648\u0646\u0647 \u0647\u0627\u06cc \u0628\u0633\u06cc\u0627\u0631 \u0632\u06cc\u0627\u062f\u06cc \u0628\u0631\u0627\u06cc \u0627\u06cc\u0646\u06a9\u0627\u0631 \u0631\u067e \u0634\u062f\u0647 \u06a9\u0647 \u062a\u0648 \u0647\u0645\u06cc\u0646 \u0633\u0627\u06cc\u062a \u0647\u0645 \u0645\u0648\u062c\u0648\u062f \u0647\u0633\u062a. \u0627\u0645\u0627 \u0686\u0648\u0646 \u06a9\u062f \u0632\u06cc\u0631\u060c \u062f\u0631 B4A \u0648 \u0647\u0645 \u062f\u0631 B4J \u0648 \u0647\u0645 \u062f\u0631 B4i \u0642\u0627\u0628\u0644 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0647\u0633\u062a\u060c \u0627\u06cc\u0646\u062c\u0627 \u0645\u06cc\u0630\u0627\u0631\u0645\u0634.(\u0628\u0647\u0645\u06cc\u0646 \u062e\u0627\u0637\u0631 \u0639\u0646\u0648\u0627\u0646 \u062a\u0627\u067e\u06cc\u06a9 \u0631\u0648 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":468,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1115],"class_list":["post-5019","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1","tag----b4x"],"_links":{"self":[{"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/posts\/5019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/comments?post=5019"}],"version-history":[{"count":0,"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/posts\/5019\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/media\/468"}],"wp:attachment":[{"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/media?parent=5019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/categories?post=5019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crypt3r.ir\/wp\/wp-json\/wp\/v2\/tags?post=5019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}