# imgui_python_rk3588
**Repository Path**: 201302713/imgui_python_rk3588
## Basic Information
- **Project Name**: imgui_python_rk3588
- **Description**: imgui_python
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-11-15
- **Last Updated**: 2024-11-15
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
bimpy - bundled imgui for python
================================
| Core API | Using `bimpy.App` class |
| ```python import bimpy as bp ctx = bp.Context() ctx.init(600, 600, "Hello") s = bp.String() f = bp.Float() while not ctx.should_close(): with ctx: bp.text("Hello, world!") if bp.button("OK"): print(s.value) bp.input_text('string', str, 256) bp.slider_float("float", f, 0, 1) ``` | ```python import bimpy as bp class App(bp.App): def __init__(self): super(App, self).__init__(title='Test') self.s = bp.String() self.f = bp.Float() def on_update(self): bp.text("Hello, world!") if bp.button("OK"): print(self.s.value) bp.input_text('string', self.s, 256) bp.slider_float("float", self.f, 0, 1) app = App() app.run() ``` |
| ```python import bimpy from PIL import Image ctx = bimpy.Context() ctx.init(800, 800, "Image") image = Image.open("test.png") im = bimpy.Image(image) while not ctx.should_close(): with ctx: bimpy.text("Display PIL Image") bimpy.image(im) ``` |  |
| ```python import bimpy from PIL import Image import numpy as np ctx = bimpy.Context() ctx.init(800, 800, "Image") image = np.asarray(Image.open("3.png"), dtype=np.uint8) im = bimpy.Image(image) while not ctx.should_close(): with ctx: bimpy.text("Display Image of type:") bimpy.same_line() bimpy.text(str(type(image))) bimpy.image(im) ``` |  |
| ```python import bimpy as bp ctx = bp.Context() ctx.init(600, 600, "Hello") bp.load_fonts( chinese=True, latin_ext=True, japanese=True, cyrillic=True ) while not ctx.should_close(): with ctx: chinese = u"學而不思則罔,思而不學則殆。" japanese = u"二兎を追う者は一兎をも得ず。 " hiragana = u"あ い う え お か ..." katakana = u"ア イ ウ エ オ カ ..." kanji = "川 月 木 心 火 左 北 今..." ukrainian = "Садок вишневий коло..." polish = "Hej, tam gdzieś z nad..." russian = "Ночь, улица, фонарь, ..." bp.text('Chinese:') bp.indent() bp.text(chinese) bp.unindent() bp.text('Japanese:') bp.indent() bp.text(japanese) bp.bullet_text("hiragana: " + hiragana) bp.bullet_text("katakana: " + katakana) bp.bullet_text("kanji: " + kanji) bp.unindent() bp.separator() bp.text('Ukrainian:') bp.indent() bp.text(ukrainian) bp.unindent() bp.separator() bp.text('Polish:') bp.indent() bp.text(polish) bp.unindent() bp.separator() bp.text('Russian:') bp.indent() bp.text(russian) bp.unindent() bp.separator() ``` |  |