Skip to main content

A Python wrapper for the Windows Direct2D and DirectWrite APIs

Project description

pyD2D - A Python wrapper for the Windows Direct2D API

pyD2D is a Python wrapper for the Windows Direct2D and DirectWrite APIs.

Note: Not all of the Direct2D and DirectWrite APIs are wrapped, but the most commonly used ones are. If you need a specific API that is not wrapped, feel free to open an issue or submit a pull request.

Installation

pip install pyd2d

Usage

See the demo app for a working example app using pyD2D and ctypes.

Basic usage is as below:

import pyd2d

# Initialize COM
pyd2d.InitializeCOM()

# Create a Direct2D factory
factory = pyd2d.GetD2DFactory()

# Create a render target
render_target = factory.CreateHwndRenderTarget(
    my_hwnd, width=800, height=600,
)

# Draw a rectangle
render_target.BeginDraw()
render_target.Clear(1.0, 1.0, 1.0, 1.0)
render_target.FillRectangle(
    100, 100, 200, 200,
    render_target.CreateSolidColorBrush(0.0, 0.0, 0.0, 1.0),
)
render_target.EndDraw()

# Release resources
render_target.Release()
factory.Release()
pyd2d.UninitializeCOM()

License

pyD2D is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyd2d-0.2.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyd2d-0.2.0-cp314-cp314t-win_amd64.whl (101.2 kB view details)

Uploaded CPython 3.14tWindows x86-64

pyd2d-0.2.0-cp314-cp314t-win32.whl (85.2 kB view details)

Uploaded CPython 3.14tWindows x86

pyd2d-0.2.0-cp314-cp314-win_amd64.whl (91.1 kB view details)

Uploaded CPython 3.14Windows x86-64

pyd2d-0.2.0-cp314-cp314-win32.whl (78.2 kB view details)

Uploaded CPython 3.14Windows x86

pyd2d-0.2.0-cp313-cp313t-win_amd64.whl (96.3 kB view details)

Uploaded CPython 3.13tWindows x86-64

pyd2d-0.2.0-cp313-cp313t-win32.whl (82.4 kB view details)

Uploaded CPython 3.13tWindows x86

pyd2d-0.2.0-cp313-cp313-win_amd64.whl (88.9 kB view details)

Uploaded CPython 3.13Windows x86-64

pyd2d-0.2.0-cp313-cp313-win32.whl (76.5 kB view details)

Uploaded CPython 3.13Windows x86

pyd2d-0.2.0-cp312-cp312-win_amd64.whl (88.6 kB view details)

Uploaded CPython 3.12Windows x86-64

pyd2d-0.2.0-cp312-cp312-win32.whl (80.3 kB view details)

Uploaded CPython 3.12Windows x86

pyd2d-0.2.0-cp311-cp311-win_amd64.whl (89.6 kB view details)

Uploaded CPython 3.11Windows x86-64

pyd2d-0.2.0-cp311-cp311-win32.whl (81.5 kB view details)

Uploaded CPython 3.11Windows x86

pyd2d-0.2.0-cp310-cp310-win_amd64.whl (89.0 kB view details)

Uploaded CPython 3.10Windows x86-64

pyd2d-0.2.0-cp310-cp310-win32.whl (81.2 kB view details)

Uploaded CPython 3.10Windows x86

pyd2d-0.2.0-cp39-cp39-win_amd64.whl (89.3 kB view details)

Uploaded CPython 3.9Windows x86-64

pyd2d-0.2.0-cp39-cp39-win32.whl (81.4 kB view details)

Uploaded CPython 3.9Windows x86

File details

Details for the file pyd2d-0.2.0.tar.gz.

File metadata

  • Download URL: pyd2d-0.2.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e1cdbbe179add9c019dc77052299951a2f4710eec858f1b7179ae1f2e6ff32b7
MD5 3a62b6e3610568fb29694b8155241150
BLAKE2b-256 071957d87eb19c3e69bf9fe0e8196565a76044439a197280d0d5bf25ca1a4a8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0.tar.gz:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 101.2 kB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 4bb6f21f93a732c5f268c12a621bfb0e4f75f1f9462a694beb8f4d0efe8458a6
MD5 222461954fd40140657f321faebd67a5
BLAKE2b-256 aacfce6a58ded32d8f82ca2bee3a782d3183c734186f641a1953fe2242300d92

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp314-cp314t-win_amd64.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp314-cp314t-win32.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp314-cp314t-win32.whl
  • Upload date:
  • Size: 85.2 kB
  • Tags: CPython 3.14t, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp314-cp314t-win32.whl
Algorithm Hash digest
SHA256 152f055095c2466d78ddab0d83e35a33905011d36523dea07b66b548070ac609
MD5 5369cd53e34ab4ffbaf96edab2a1f569
BLAKE2b-256 1b644e85a4515f48c3d5937937cec8e35e32da06eddd846851743a46ca135100

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp314-cp314t-win32.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 91.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 6c0f76f3fceea532697c532608ed104c723b050db46b623e7d4517c5cd31575f
MD5 722b95e70691fcfc38c34c8e2514ef55
BLAKE2b-256 8dfc941f0392deeab856cd48ed3789e170aa8fa720de3b667b23295974fb7f0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp314-cp314-win_amd64.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp314-cp314-win32.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp314-cp314-win32.whl
  • Upload date:
  • Size: 78.2 kB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 3dd9cc2c215c467782908a811a4a8a498f0f9bbbc410aeb7029ae5e3dccc42ff
MD5 09d6e5d176719e8de421db721acb2864
BLAKE2b-256 de95280862716ed35834b60c57c5d879d74fb2dbf7a64f96212dd1fcf1d1bbe8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp314-cp314-win32.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp313-cp313t-win_amd64.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp313-cp313t-win_amd64.whl
  • Upload date:
  • Size: 96.3 kB
  • Tags: CPython 3.13t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 182c1edf86b2c157a7ed15600609dc40dde6898cd3e621395b10c213d5be8955
MD5 9570171898e10e649f9279be614a3393
BLAKE2b-256 997789c6c31b23a20445735808b2d9798dba9fc49b73141bd34b709d4c060a91

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp313-cp313t-win_amd64.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp313-cp313t-win32.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp313-cp313t-win32.whl
  • Upload date:
  • Size: 82.4 kB
  • Tags: CPython 3.13t, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp313-cp313t-win32.whl
Algorithm Hash digest
SHA256 414126228358637c7e57eb871cce9acfcb0cdc285b564fad69178850a632afbd
MD5 a4a7fcc3b116d29822919cc335a0d260
BLAKE2b-256 5afe50315c966a24a1c2b933e6d1fb4b6fc69cdfbe80b0e634462cc98200c0b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp313-cp313t-win32.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 88.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 04a811f82e750bdd1413b0d3a99297f208807f41777160bce6bc7209d7ff0a5c
MD5 99f31e0f6632e165b81422c6ad180e07
BLAKE2b-256 dc3be4bb5f209e45dcf2151e513b43a222ba6f25f913cf6781a260d2b725e0f6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp313-cp313-win32.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp313-cp313-win32.whl
  • Upload date:
  • Size: 76.5 kB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 f6ebd0c4cd6c0eae6f16bc26df2052ec57e0e890bb8b2f4b62bbc70e2fbe51cf
MD5 ea45d4bf274212f074bf53a7ba3c0502
BLAKE2b-256 34596a4d9a03f379ebc88cb7ecae8c54a5ede1699fdb00bd3c5503e45301b9eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp313-cp313-win32.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 88.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f3ea2b42d523eb91d9ae694ae67a9ab3a8cae140ef3f6b79c09a2b0e112e4541
MD5 251b9f6241d0ca64eaaac8051ae2243e
BLAKE2b-256 93768780c7402eae68d7d8a508a29d4e9756a9b474a8aff109a0a490fef4ffd0

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp312-cp312-win32.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp312-cp312-win32.whl
  • Upload date:
  • Size: 80.3 kB
  • Tags: CPython 3.12, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 6542a7328388d6ffc38d598131469bbfa0e926d1790c68be58ae70645c927fe5
MD5 c6acb1d327a1467f3b1800a8f55be3df
BLAKE2b-256 a6ec7f47cb91cea46d98387d7444d27e293356ed4a1e448c2ab5cd673f29746d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp312-cp312-win32.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 89.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 e8caa38cc936f78cfc44ca572b410f27df36f7d9b9c8e539d4a837352418be3a
MD5 9af57d8ed2201e115fd878dcefd3161e
BLAKE2b-256 438df51a89fcb4772c3d8889f03b7d243d30065237fd08d12b43457d9fb88d4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp311-cp311-win32.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp311-cp311-win32.whl
  • Upload date:
  • Size: 81.5 kB
  • Tags: CPython 3.11, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp311-cp311-win32.whl
Algorithm Hash digest
SHA256 c999d3ea7c38ca79c32a5ea10e4d175be03e890d1759415c602c50a29b7c9da1
MD5 09651947a57f5fe3a73ed171a2be589a
BLAKE2b-256 9eac1941bfe6c5336da3dae5922cbc4a6456c939138bdc80d6b1ea869a816554

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp311-cp311-win32.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 89.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 6a725170532dd8b099972356d0f80827510e41d1878aa000b4b77d92302551bf
MD5 c8641909d0e6a43bc9b9125ebef2d837
BLAKE2b-256 06c5c17da414504b18ecb10256ac4cebf4e08f609b7b559f63da971dcd093e60

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp310-cp310-win32.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp310-cp310-win32.whl
  • Upload date:
  • Size: 81.2 kB
  • Tags: CPython 3.10, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp310-cp310-win32.whl
Algorithm Hash digest
SHA256 c0cd89d9d5d6bec6f3b8f6b37a2f00718e41c2f76dbf7e33ef65334dc161879b
MD5 8827074c6045ea113d7b81c4a2e4a088
BLAKE2b-256 f4aac4dbe1fccd6ed79bd6ca11370940a3762dba72cfc2c23d6297c921810dff

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp310-cp310-win32.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 89.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cdc4e65aaa1f2fc7ce2f7ff8796227fcf05288c9316fdefc6e40d3f2f137c1ea
MD5 d05d88d4306eae92d75025ea3571ebab
BLAKE2b-256 2367a37c6f1f6cde377cb93dee41dcdf3928e1f11fc0be6850e7bc8f87eb867f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp39-cp39-win_amd64.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyd2d-0.2.0-cp39-cp39-win32.whl.

File metadata

  • Download URL: pyd2d-0.2.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 81.4 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyd2d-0.2.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 51435b0ddd33081e89d26c54169512d046dbba7450a29dc2ec9f4540938c283d
MD5 cbe7658078e25c4be55f1209cb66a2ca
BLAKE2b-256 c837149826ad59b21182a7b206a6dc978590a2d6e3eb82d0955d7c076aa4555e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyd2d-0.2.0-cp39-cp39-win32.whl:

Publisher: publish.yml on merlinz01/pyd2d

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page