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.
Note: This project may not have prebuilt wheels for your Python version. If you need a wheel that's missing, please open an issue.
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()
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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyd2d-0.1.3.tar.gz.
File metadata
- Download URL: pyd2d-0.1.3.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aed674fe3d63affd0e40de88f68649f4dc6583062191fbeaffc499942f19e633
|
|
| MD5 |
cf871b3a2eaf6ddb2e87d4fff57b5edc
|
|
| BLAKE2b-256 |
4d4dd4028820e5bec7a99daaf4573d1fb3e33267c7b4a64f98e684f87ee27eb9
|
Provenance
The following attestation bundles were made for pyd2d-0.1.3.tar.gz:
Publisher:
publish.yml on merlinz01/pyd2d
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyd2d-0.1.3.tar.gz -
Subject digest:
aed674fe3d63affd0e40de88f68649f4dc6583062191fbeaffc499942f19e633 - Sigstore transparency entry: 646418403
- Sigstore integration time:
-
Permalink:
merlinz01/pyd2d@c508515a4f4572ff7eab1f35c355e2dae9c71289 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/merlinz01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c508515a4f4572ff7eab1f35c355e2dae9c71289 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyd2d-0.1.3-cp314-cp314-win32.whl.
File metadata
- Download URL: pyd2d-0.1.3-cp314-cp314-win32.whl
- Upload date:
- Size: 83.3 kB
- Tags: CPython 3.14, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b9551d836c7598ec310efdf74a0eac234563b7faff409f67132e1df46eb4baa
|
|
| MD5 |
9673e63ec0f9f53c24b0ad5cb94799a3
|
|
| BLAKE2b-256 |
8f56b4180c6bdeddde70a351089c9c5d7b771e865854d903cce2a8f9c8001e64
|
Provenance
The following attestation bundles were made for pyd2d-0.1.3-cp314-cp314-win32.whl:
Publisher:
publish.yml on merlinz01/pyd2d
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyd2d-0.1.3-cp314-cp314-win32.whl -
Subject digest:
8b9551d836c7598ec310efdf74a0eac234563b7faff409f67132e1df46eb4baa - Sigstore transparency entry: 646418453
- Sigstore integration time:
-
Permalink:
merlinz01/pyd2d@c508515a4f4572ff7eab1f35c355e2dae9c71289 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/merlinz01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c508515a4f4572ff7eab1f35c355e2dae9c71289 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyd2d-0.1.3-cp313-cp313-win32.whl.
File metadata
- Download URL: pyd2d-0.1.3-cp313-cp313-win32.whl
- Upload date:
- Size: 81.2 kB
- Tags: CPython 3.13, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04dc9b38fa7bb8eca69f9eaed9d1f1b1729231f0dc2a339e657a151186f1925b
|
|
| MD5 |
ad6f2bf3f4ba57bba6b61d1b4541eedb
|
|
| BLAKE2b-256 |
bb0780d4e6261bc89c28598e47889ba3664937336641d7d21545d65f60b18af6
|
Provenance
The following attestation bundles were made for pyd2d-0.1.3-cp313-cp313-win32.whl:
Publisher:
publish.yml on merlinz01/pyd2d
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyd2d-0.1.3-cp313-cp313-win32.whl -
Subject digest:
04dc9b38fa7bb8eca69f9eaed9d1f1b1729231f0dc2a339e657a151186f1925b - Sigstore transparency entry: 646418477
- Sigstore integration time:
-
Permalink:
merlinz01/pyd2d@c508515a4f4572ff7eab1f35c355e2dae9c71289 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/merlinz01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c508515a4f4572ff7eab1f35c355e2dae9c71289 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyd2d-0.1.3-cp312-cp312-win32.whl.
File metadata
- Download URL: pyd2d-0.1.3-cp312-cp312-win32.whl
- Upload date:
- Size: 85.2 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57296e48047c8bfc26298350900b7719110c4e24d98f1fe9164cc3e72b48be73
|
|
| MD5 |
b4c12c6e489ad80a6a30598d0ee316b6
|
|
| BLAKE2b-256 |
ce9936e251409fb2ad997b4f930b2f49a130ec7e19f77e783d23bd413a98265a
|
Provenance
The following attestation bundles were made for pyd2d-0.1.3-cp312-cp312-win32.whl:
Publisher:
publish.yml on merlinz01/pyd2d
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyd2d-0.1.3-cp312-cp312-win32.whl -
Subject digest:
57296e48047c8bfc26298350900b7719110c4e24d98f1fe9164cc3e72b48be73 - Sigstore transparency entry: 646418414
- Sigstore integration time:
-
Permalink:
merlinz01/pyd2d@c508515a4f4572ff7eab1f35c355e2dae9c71289 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/merlinz01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c508515a4f4572ff7eab1f35c355e2dae9c71289 -
Trigger Event:
push
-
Statement type: