{"id":83,"date":"2026-02-25T18:57:24","date_gmt":"2026-02-25T10:57:24","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=83"},"modified":"2026-01-17T10:35:38","modified_gmt":"2026-01-17T10:35:38","slug":"how-to-set-face-properties-using-xlwings-picture-fill","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-set-face-properties-using-xlwings-picture-fill\/","title":{"rendered":"How To Set Face Properties Using xlwings? &#8211; Picture Fill"},"content":{"rendered":"<h2>Method<\/h2>\n<p>Use the `UserPicture` method of the `FillFormat` object for picture fills.<\/p>\n<p>\u00a0<\/p>\n<p>shp1=sht.api.Shapes.AddShape(1, 100, 50, 200, 100)\u00a0\u00a0\u00a0 #Rectangular area<\/p>\n<p>ff1=shp1.Fill<\/p>\n<p>ff1.UserPicture(r&#8221;D:\\picpy.jpg&#8221;)\u00a0\u00a0\u00a0 #Picture fill<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Area properties - Texture fill\n\nimport xlwings as xw    #Import xlwings package\nimport os\nroot = os.getcwd()\napp=xw.App()\nbk=app.books.active   #Get the active workbook\nsht=bk.sheets.active    #Get the active worksheet\n\nshp1=sht.api.Shapes.AddShape(1, 100, 50, 200, 100)    #Rectangular area\nff1=shp1.Fill\nff1.UserTextured(r\"D:\/picpy.jpg\")    #Texture fill\n\nshp2=sht.api.Shapes.AddShape(9, 400, 50, 200, 100)    #Elliptical area\nff2=shp2.Fill\nff2.UserTextured(r\"D:\/picpy.jpg\")    #Texture fill\n\n#bk.save()\n#bk.close()\n#app.kill()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"482\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-11.png\" alt=\"How To Set Face Properties Using xlwings? - Picture Fill\" class=\"wp-image-442\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-11.png 883w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-11-300x164.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-11-768x419.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Method<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-83","post","type-post","status-publish","format-standard","hentry","category-xlwings-shape"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/83","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=83"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions"}],"predecessor-version":[{"id":443,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/83\/revisions\/443"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=83"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=83"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=83"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}