Los datos de un objecto Imagen son manejados por unos recursos que estan en los archvos fuentes "gb.image.h" y "gambas.h" . En particular los datos de un objecto Imagen son almacenados en la Estructura GB_IMG, que en ingles mostramos:
typedef
struct GB_IMG {
GB_BASE ob;
unsigned char *data; // points at the image data
int width; // image width in pixels
int height; // image height in pixels
int format; // image format (RGB, BGR, RGBA...)
GB_IMG_OWNER *owner; // owner of the data, NULL means gb.image
void *owner_handle; // handle for the owner
GB_IMG_OWNER *temp_owner; // owner of the temporary handle that does not own the data
void *temp_handle; // temporary handle
unsigned modified : 1; // data has been modified by gb.image
unsigned sync : 1; // data must be synchronized by calling GB_IMG_OWNER.sync()
unsigned is_void : 1; // void image (no data)
}
GB_IMG;
struct GB_IMG {
GB_BASE ob;
unsigned char *data; // points at the image data
int width; // image width in pixels
int height; // image height in pixels
int format; // image format (RGB, BGR, RGBA...)
GB_IMG_OWNER *owner; // owner of the data, NULL means gb.image
void *owner_handle; // handle for the owner
GB_IMG_OWNER *temp_owner; // owner of the temporary handle that does not own the data
void *temp_handle; // temporary handle
unsigned modified : 1; // data has been modified by gb.image
unsigned sync : 1; // data must be synchronized by calling GB_IMG_OWNER.sync()
unsigned is_void : 1; // void image (no data)
}
GB_IMG;
In gambas codice Punctatris in memoriae area huius Structurae legere possumus:
En gambas podemos leer con los Punteros en la area de memoria de esta Esctructura:
Public Sub Main()
Dim im As Image
Dim p1, p2 As Pointer
im = Image.Load("/iter/imaginis/archivii - /ruta/del/archivo/imagen")
' Intuetur imaginem obiectum / Apunta a el objecto Imagen:
p1 = Object.Address(im)
' Dicit quod obiectum esse / Dice que tipo de objecto es:
Print String@(Pointer@(Pointer@(p1) + 24))
' Intuetur imaginis data / Apunta a los datos Imagen:
p2 = pointer@(p1 + 16)
' Intuetur imaginis latitudinem / Apunta a la anchura de la Imagen:
Print Int@(p1 + 24);; "pixel"
' Intuetur imaginis proceritatem / Apunta a la altura de la Imagen:
Print Int@(p1 + 28);; "pixel"
' Intuetur imaginis specimen / Apunta a el formato de la Imagen :
Print Int@(p1 + 32)
' Intuetur imaginum gambas componentem / Apunta a el Componente gambas que maneja este objecto Imagen:
Print String@(Pointer@(Pointer@(p1 + 40)))
End
Dim im As Image
Dim p1, p2 As Pointer
im = Image.Load("/iter/imaginis/archivii - /ruta/del/archivo/imagen")
' Intuetur imaginem obiectum / Apunta a el objecto Imagen:
p1 = Object.Address(im)
' Dicit quod obiectum esse / Dice que tipo de objecto es:
Print String@(Pointer@(Pointer@(p1) + 24))
' Intuetur imaginis data / Apunta a los datos Imagen:
p2 = pointer@(p1 + 16)
' Intuetur imaginis latitudinem / Apunta a la anchura de la Imagen:
Print Int@(p1 + 24);; "pixel"
' Intuetur imaginis proceritatem / Apunta a la altura de la Imagen:
Print Int@(p1 + 28);; "pixel"
' Intuetur imaginis specimen / Apunta a el formato de la Imagen :
Print Int@(p1 + 32)
' Intuetur imaginum gambas componentem / Apunta a el Componente gambas que maneja este objecto Imagen:
Print String@(Pointer@(Pointer@(p1 + 40)))
End
N.B.: pro 64-bit sistematibus.
N.B.: para sistemas de 64-bit