App:Library:LVGL:docs:Widgets:Image (lv img)
https://docs.lvgl.io/8.2/widgets/core/arc.html
Image (lv_img)
Overview
英文 | 自動翻訳 |
---|---|
Images are the basic object to display images from flash (as arrays) or from files. Images can display symbols ( Using the Image decoder interface custom image formats can be supported as well. |
イメージは、フラッシュからのイメージ(配列として)やファイルからのイメージを表示するための基本的なオブジェクトです。イメージはシンボル(LV_SYMBOL_... ) も表示することができます。
イメージデコーダインタフェースを使用すると、カスタムイメージフォーマットもサポートできます。 |
Parts and Styles
英文 | 自動翻訳 |
---|---|
|
|
Usage
Image source
英文 | 自動翻訳 |
---|---|
To provide maximum flexibility, the source of the image can be:
To set the source of an image, use To generate a pixel array from a PNG, JPG or BMP image, use the Online image converter tool and set the converted image with its pointer: To use external files, you also need to convert the image files using the online converter tool but now you should select the binary output format. You also need to use LVGL's file system module and register a driver with some functions for the basic file operation. Go to the File system to learn more. To set an image sourced from a file, use You can also set a symbol similarly to Labels. In this case, the image will be rendered as text according to the font specified in the style. It enables to use of light-weight monochrome "letters" instead of real images. You can set symbol like |
PNG、JPG、BMP画像からピクセル配列を生成するには、オンライン画像変換ツールを使い、変換後の画像をそのポインタにセットします:
|
Label as an image
英文 | 自動翻訳 |
---|---|
Images and labels are sometimes used to convey the same thing. For example, to describe what a button does. Therefore, images and labels are somewhat interchangeable, that is the images can display texts by using |
画像とラベルは、同じことを伝えるために使われることがあります。例えば、ボタンが何をするものかを説明するためである。つまり、画像は、LV_SYMBOL_DUMMY をテキストの接頭辞として使用することにより、テキストを表示することができるのです。例えば、lv_img_set_src(img, LV_SYMBOL_DUMMY "Some text") とします。
|
Transparency
英文 | 自動翻訳 |
---|---|
The internal (variable) and external images support 2 transparency handling methods:
|
内部(変数)および外部イメージは,2つの透明度処理方法をサポートしています.
|
Palette and Alpha index
英文 | 自動翻訳 |
---|---|
Besides the True color (RGB) color format, the following formats are supported:
To learn more about the color formats, read the Images section. |
カラーフォーマットは、トゥルーカラー(RGB)以外に、以下のフォーマットをサポートしています。
カラーフォーマットについて詳しくは、「画像」のセクションをお読みください。 |
Recolor
英文 | 自動翻訳 |
---|---|
A color can be mixed with every pixel of an image with a given intensity. This can be useful to show different states (checked, inactive, pressed, etc.) of an image without storing more versions of the same image.
The default value is The color to mix is set by |
色は、与えられた強度を持つ画像の各ピクセルと混合することができます。
これは、同じ画像の多くのバージョンを保存することなく、画像の異なる状態(チェック済み、非アクティブ、押された、など)を表示するのに便利である。
デフォルト値は
|
Auto-size
英文 | 自動翻訳 |
---|---|
If the width or height of the image object is set to |
画像オブジェクトの幅または高さがLV_SIZE_CONTENT に設定されている場合、オブジェクトのサイズは画像ソースの各方向のサイズに応じて設定されます。
|
Mosaic
英文 | 自動翻訳 |
---|---|
If the object's size is greater than the image size in any directions, then the image will be repeated like a mosaic.
|
被写体の大きさが画像サイズより大きい方向があれば、モザイクのように画像が繰り返されます。
|
Offset
英文 | 自動翻訳 |
---|---|
With Useful if the object size is smaller than the image source size.
|
lv_img_set_offset_x(img, x_ofs) とlv_img_set_offset_y(img, y_ofs) で、表示画像にオフセットをかけることができます。
オブジェクトのサイズが画像ソースのサイズより小さい場合に便利です。
|
Transformations
英文 | 自動翻訳 |
---|---|
Using the A larger value enlarges the images (e.g. Fractional scale works as well. E.g. To rotate the image use The By default, the pivot point of the rotation is the center of the image. It can be changed with
With enabled anti-aliasing the transformations are higher quality but slower.
That is |
lv_img_set_zoom(img, factor) を使用すると、画像がズームされる。factor に256 を指定するか、LV_IMG_ZOOM_NONE を指定するとズームが無効になります。
値が大きいと画像は拡大され(例: 分数倍率も有効です。例:
角度の精度は0.1度なので、45.8度なら458を設定します。
|
Size mode
英文 | 自動翻訳 |
---|---|
By default, when the image is zoomed or rotated the real coordinates of the image object are not changed. The larger content simply overflows the object's boundaries.
(The previous mode is the default and called
If an explicit size is set then the overflowing content will be cropped. |
デフォルトでは、画像をズームしたり回転させたりしても、画像オブジェクトの実座標は変更されない。
より大きなコンテンツは、単にオブジェクトの境界をオーバーフローするだけです。
(前のモードはデフォルトで、
明示的なサイズが設定されている場合、はみ出したコンテンツは切り取られます。 |
Rounded image
英文 | 自動翻訳 |
---|---|
You can use
|
lv_obj_set_style_radius を使用して画像に半径を設定し、 lv_obj_set_style_clip_corner を有効にしてコンテンツを丸い矩形または円形にクリップすることができます。
|
Events
英文 | 自動翻訳 |
---|---|
No special events are sent by image objects. See the events of the Base object too. Learn more about Events. |
イメージオブジェクトによって送信される特別なイベントはありません。
Baseオブジェクトのイベントも参照してください。 イベントの詳細を確認してください。 |
Keys
英文 | 自動翻訳 |
---|---|
No Keys are processed by the object type. Learn more about Keys. |
オブジェクトタイプによって処理されるキーはありません。
キーの詳細を確認してください。 |
Example
英文 | 自動翻訳 |
---|---|
Image from variable and symbol |
|
Image recoloring |
|
Rotate and zoom |
|
Image offset and styling |
API
英文 | 自動翻訳 |
---|---|
Typedefs typedef uint8_t lv_img_size_mode_t Enums enum [anonymous]
Functions lv_obj_t *lv_img_create(lv_obj_t *parent)
void lv_img_set_src(lv_obj_t *obj, const void *src)
void lv_img_set_offset_x(lv_obj_t *obj, lv_coord_t x)
void lv_img_set_offset_y(lv_obj_t *obj, lv_coord_t y)
void lv_img_set_angle(lv_obj_t *obj, int16_t angle)
void lv_img_set_pivot(lv_obj_t *obj, lv_coord_t x, lv_coord_t y)
void lv_img_set_zoom(lv_obj_t *obj, uint16_t zoom) void lv_img_set_antialias(lv_obj_t *obj, bool antialias)
void lv_img_set_size_mode(lv_obj_t *obj, lv_img_size_mode_t mode)
const void *lv_img_get_src(lv_obj_t *obj)
lv_coord_t lv_img_get_offset_x(lv_obj_t *obj)
lv_coord_t lv_img_get_offset_y(lv_obj_t *obj)
uint16_t lv_img_get_angle(lv_obj_t *obj)
void lv_img_get_pivot(lv_obj_t *obj, lv_point_t *pivot)
uint16_t lv_img_get_zoom(lv_obj_t *obj)
bool lv_img_get_antialias(lv_obj_t *obj)
lv_img_size_mode_t lv_img_get_size_mode(lv_obj_t *obj)
Variables const lv_obj_class_t lv_img_class struct lv_img_t
|
typedef uint8_t lv_img_size_mode_t 列挙型 列挙型[匿名]
機能 lv_obj_t * lv_img_create(lv_obj_t * parent)
void lv_img_set_src(lv_obj_t * obj、const void * src)
void lv_img_set_offset_x(lv_obj_t * obj、lv_coord_t x)
void lv_img_set_offset_y(lv_obj_t * obj、lv_coord_t y)
void lv_img_set_angle(lv_obj_t * obj、int16_t angle)
void lv_img_set_pivot(lv_obj_t * obj、lv_coord_t x、lv_coord_t y)
void lv_img_set_zoom(lv_obj_t * obj、uint16_tズーム) void lv_img_set_antialias(lv_obj_t * obj、bool antialias)
void lv_img_set_size_mode(lv_obj_t * obj、lv_img_size_mode_t mode)
const void * lv_img_get_src(lv_obj_t * obj)
lv_coord_t lv_img_get_offset_x(lv_obj_t * obj)
lv_coord_t lv_img_get_offset_y(lv_obj_t * obj)
uint16_t lv_img_get_angle(lv_obj_t * obj)
void lv_img_get_pivot(lv_obj_t * obj、lv_point_t *ivot)
uint16_t lv_img_get_zoom(lv_obj_t * obj)
bool lv_img_get_antialias(lv_obj_t * obj)
lv_img_size_mode_t lv_img_get_size_mode(lv_obj_t * obj)
変数 const lv_obj_class_t lv_img_class struct lv_img_t
|