Peut-on insérer une image dans scintilla ?
Et si oui comment ?
Mesa.
Scintilla
Re: Scintilla
google Translate :Images
Two formats are supported for images used in margin markers and autocompletion lists, RGBA and XPM.
RGBA
The RGBA format allows translucency with an alpha value for each pixel. It is simpler than XPM and more capable.
The data is a sequence of 4 byte pixel values starting with the pixels for the top line, with the leftmost pixel first, then continuing with the pixels for subsequent lines. There is no gap between lines for alignment reasons.
Each pixel consists of, in order, a red byte, a green byte, a blue byte and an alpha byte. The colour bytes are not premultiplied by the alpha value. That is, a fully red pixel that is 25% opaque will be [FF, 00, 00, 3F]
Since the RGBA pixel data does not include any size information the width and height must previously been set with the SCI_RGBAIMAGESETWIDTH and SCI_RGBAIMAGESETHEIGHT messages.
GUI platforms often include functions for reading image file formats like PNG into memory in the RGBA form or a similar form. If there is no suitable platform support, the LodePNG and picoPNG libraries are small libraries for loading and decoding PNG files available under a BSD-style license.
RGBA format is supported on Windows, GTK+ and OS X Cocoa. It is not supported on OS X Carbon.
XPM
The XPM format is described here. Scintilla is only able to handle XPM pixmaps that use one character per pixel with no named colours. There may be a completely transparent colour named "None".
There are two forms of data structure used for XPM images, the first "lines form" format is well suited to embedding an image inside C source code and the "text form" is suited to reading from a file. In the lines form, an array of strings is used with the first string indicating the dimensions and number of colours used. This is followed by a string for each colour and that section is followed by the image with one string per line. The text form contains the same data as one null terminated block formatted as C source code starting with a "/* XPM */" comment to mark the format.
Either format may be used with Scintilla APIs with the bytes at the location pointed to examined to determine which format: if the bytes start with "/* XPM */" then it is treated as text form, otherwise it is treated as lines form.
XPM format is supported on on all platforms.
Images
Deux formats sont supportés pour les images utilisées dans les marqueurs de marge et les listes d'auto-complétion, RGBA et XPM.
RGBA
Le format RGBA permet translucidité avec une valeur alpha pour chaque pixel. Il est plus simple que XPM et plus capable.
Le données est une séquence de 4 octets à partir des valeurs de pixels aux pixels pour la ligne supérieure, avec le pixel le plus à gauche d'abord, puis en continuant avec des pixels pour les lignes suivantes. Il n'ya pas d'écart entre les lignes pour des raisons d'alignement.
Chaque pixel est constitué d', dans l'ordre, un octet rouge, verte un octet, un octet bleu et un octet de l'alpha. Les octets de couleur ne sont pas prémultipliée par la valeur alpha. C'est, un pixel totalement rouge qui est de 25% opaque sera [FF, 00, 00, 3F]
Étant donné que les données de pixels RGBA ne comprend pas les informations de taille de la largeur et la hauteur doivent déjà été réglée avec les messages et SCI_RGBAIMAGESETWIDTH SCI_RGBAIMAGESETHEIGHT.
Plates-formes graphiques comportent souvent des fonctions pour la lecture des formats de fichiers d'image PNG comme dans la mémoire sous la forme RGBA ou une forme similaire. S'il n'ya pas de soutien plate-forme appropriée, les bibliothèques et LodePNG picoPNG sont de petites bibliothèques de chargement et de décodage des fichiers PNG disponibles sous une licence BSD-style.
Format RGBA est pris en charge sur Windows, GTK + et OS X Cocoa. Il n'est pas supporté sur OS X Carbon.