He visto en el foro ya que fue detectado este problema y que se aportaba una solución a través del color y usando sintaxis OOP's...
¿Alguna solución más chula...?
Gracias y una cervecita.
l3whmg wrote: ↑Wed Nov 30, 2011 10:20 am Hi friends.
I found a "problem" with bitmap. If I set Picture := "", previous loaded image doesn't disappear.
It's not a real problem because, many times, every one of us creates an empty image to load.
To avoid creating empty image, I add method EmptyColor( aArg1 ), where aArg1 is an array of RGB colors. By default, this is an empty array.
When bitmap fails to load the image, if EmptyColor has a valid array of RGB colors a colored image will be created
In this way, you can always see an image: existing image or empty image.
If you reset ( EmptyColor := {} ), you don't will see a colored image and the bitmap behaviour will be like today.
Usage with OOP syntaxCode: Select all
WITH OBJECT ::oImage := BITMAP():New() :Row := 150 :Col := 65 :Width := 500 :Height := 300 :Picture := "" :Stretch := .T. :EmptyColor := { 158, 158, 158 } END WITH
CheersCode: Select all
2011-11-30 11:10 UTC+0100 Luigi Ferraris ( <luigi at l3w.it> ) * source/bitmap.prg + EmptyColor( aArg1 ) method where aArg1 is an array of RGB colors or an empty array (by default empty array). When bitmap fails to load the image, if EmptyColor has a valid array of RGB colors, a colored image will be created.