{"id":518,"date":"2026-03-27T17:46:24","date_gmt":"2026-03-27T09:46:24","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=518"},"modified":"2026-03-23T06:26:16","modified_gmt":"2026-03-23T06:26:16","slug":"how-to-set-picturetexture-fill-for-areas-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-set-picturetexture-fill-for-areas-using-xlwings\/","title":{"rendered":"How To Set Picture\/Texture Fill for Areas Using xlwings?"},"content":{"rendered":"<p>\u3010<b>Method<\/b>\u3011<\/p>\n<p>FillFormat object<\/p>\n<ul>\n<li>UserPicture method<\/li>\n<li>UserTextured method<\/li>\n<\/ul>\n<p>sht.api.Range(&#8216;A1:B7&#8217;).Select()<\/p>\n<p>cht=sht.api.Shapes.AddChart().Chart<\/p>\n<p>ser=cht.SeriesCollection(&#8216;P1&#8217;)\u00a0\u00a0\u00a0\u00a0\u00a0 #First series<\/p>\n<p>ff=ser.Format.Fill<\/p>\n<p>ff.UserPicture(root+r&#8217;\/picpy.jpg&#8217;)<\/p>\n<p>ser2=cht.SeriesCollection(&#8216;P2&#8217;)\u00a0\u00a0\u00a0\u00a0\u00a0 #Second series<\/p>\n<p>ff2=ser2.Format.Fill<\/p>\n<p>ff2.UserTextured(root+r&#8217;\/picpy2.jpg&#8217;)<\/p>\n<p>\u3010<b>Example<\/b>\u3011<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"768\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/2-01-4.jpg\" alt=\"\" class=\"wp-image-1114\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/2-01-4.jpg 880w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/2-01-4-300x262.jpg 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/2-01-4-768x670.jpg 768w\" sizes=\"auto, (max-width: 880px) 100vw, 880px\" \/><\/figure>\n\n\n\n<p>\u3010<strong>Code<\/strong>\u3011<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Area settings - Picture and texture fill\n\nimport xlwings as xw\nimport os\n\nroot = os.getcwd()\napp = xw.App(visible=True, add_book=False)\nwb=app.books.open(root+r'\/P1P2.xlsx',read_only=False)\nsht=wb.sheets(1)\n\nsht.api.Range('A1:B7').Select()\ncht=sht.api.Shapes.AddChart().Chart\nser=cht.SeriesCollection('P1')      #First series\nff=ser.Format.Fill\nff.UserPicture(root+r'\/picpy.jpg')\nser2=cht.SeriesCollection('P2')      #Second series\nff2=ser2.Format.Fill\nff2.UserTextured(root+r'\/picpy2.jpg')\n\n#wb.save()\n#wb.close()\n#app.kill()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"880\" height=\"768\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/2-06.jpg\" alt=\"\" class=\"wp-image-1116\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/2-06.jpg 880w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/2-06-300x262.jpg 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/03\/2-06-768x670.jpg 768w\" sizes=\"auto, (max-width: 880px) 100vw, 880px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Method<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-518","post","type-post","status-publish","format-standard","hentry","category-xlwings-chart"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/518","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=518"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/518\/revisions"}],"predecessor-version":[{"id":1117,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/518\/revisions\/1117"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=518"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=518"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=518"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}