topic
stringlengths 1
63
| text
stringlengths 1
577k
⌀ |
|---|---|
Almacén Virtual 3D.
|
estimado:
hace años tuve esa misma inquietud, intente utilizar una librería para hacer gráficos 3d de terceros pero era muy tediosa, al final realice un programa por la cual trate de mostrar el stock disponible en cámaras de frio, con pasillos y posiciones y una "vista aérea" en 2d simulando mas menos como están las cámaras en capacidad.
la verdad sé que no sirve a tus intenciones, pero tuve una muy buena aceptación por parte de los clientes a la cual les mostré el resultado.
"esto es solo ilustrativo y es solo una idea para que puedas pensar en realizar algo parecido o mejor"
Saludos.
vista de las camaras:
[img:3nv2dais]http://i64.tinypic.com/65v1p1.png[/img:3nv2dais]
vista de pasillos:
[img:3nv2dais]http://i64.tinypic.com/jaxiq1.png[/img:3nv2dais]
vista de posiciones:
[img:3nv2dais]http://i68.tinypic.com/2h352kj.png[/img:3nv2dais]
vista aérea en 2d:
[img:3nv2dais]http://i64.tinypic.com/2igk5ee.png[/img:3nv2dais]
Saludos desde Chile.
|
Almacén Virtual 3D.
|
Hola hablando con mi jefe, y pensando en la mejor solución, vamos a optar más por la solución de Armando.
Estaría muy bien hacerlo en 3D con gafas,pero claro es que cambia constantemente.
Y para que el carretillero busque un producto no creo que llegue a ser realmente necesario, aunque conociendo al cliente, seguro que ahora no pero cuando el proyecto principal este finalizado seguro que replantea el tema.
Así que si alguien tiene hecho algo como Armando agradecería como ha hecho él, enviar algún pantalla o samples para ver que opción nos puede venir mejor.
Muchas Gracias Armando por tu ayuda. Me ha parecido una gran idea.
|
Almas caritativas Fivetouch
|
Estimados buenas noches
de tanta muda de un equipo a otro se me ha perdido todo lo que acompana a fivetouch
es decir
Harbour
Mingw
hbqt
es decir a pesar de que inclusive logre compilar con una versión de QT 5,13 ya no me ejecuta nada
si alguien tiene funcionando fivetouch con sus respectivos harbour mingw y hbqt
me seria de mucha utilidad si podría acceder a los mismos
Gracias de antemano y perdon si no me explique bien
saludos
Wilson
|
Alojamiento en Goteborg
|
[quote="Antonio Linares":jpcuggc6]Carlos,
Tal vez pueda servirle esto:
[url:jpcuggc6]http://www.couchsurfing.org/[/url:jpcuggc6][/quote:jpcuggc6]
Gracias Antonio, lo miro.
|
Alojamiento en Goteborg
|
Hola a todos,
Perdonad el Off Topic.
MI sobrina se va de Erasmus a Goteborg en 4 semanas y está teniendo problemas para encontrar alojamiento (la burocracia española se la ha "jugado").
¿Alguién tiene algun contacto en Goteborg que le puede echar un cable?
Muchas gracias.
|
Alojamiento en Goteborg
|
Carlos,
Tal vez pueda servirle esto:
[url:askvorzk]http://www.couchsurfing.org/[/url:askvorzk]
|
Alpablended-BMP on top of xBrowse-Brush or Image ?
|
Hello,
A option in my xBrowse-Tests is to show a Alphablended-BMP inside
xBrowse on top of a Brush or Image.
I tested inside the Dialog and ONPAINT.
Is it possible ?, otherwise I have to delete this option in my tests.
In my tests, I got it allways shown on the Dialog-Background.
[img:bdd1r50g]http://www.pflegeplus.com/pictures/xbrwalpha.jpg[/img:bdd1r50g]
[code:bdd1r50g]
..
oBrw5:CreateFromResource( 110 )
// Image-Brush
// ----------------
IF nArrayPos = 3 .or. nArrayPos = 8
DEFINE BRUSH oBrush5 FILENAME "MARBLE.bmp"
oBrw5:SetBackGround( oBrush5 )
RELEASE BRUSH oBrush5
oBrw5:Refresh()
ENDIF
// Alpha-BMP
// --------------
IF nArrayPos = 8
hDC := oBrw5:GETDC()
* W_ALPHA( hDC, oBrw5 )
* oBrw5:RELEASEDC()
ENDIF
REDEFINE BUTTONBMP oButton ID 30 OF oDlg5 ;
ACTION oDlg5:End() ;
BITMAP "Quit" PROMPT " Exit" TEXTRIGHT
ACTIVATE DIALOG oDlg5 CENTERED ;
ON PAINT ( W_GRAD( hDC, oDlg5 ), ;
IIF(nArrayPos = 8, ( W_ALPHA( hDC, oBrw5 ), oBrw5:RELEASEDC() ), NIL ) )
oProgFont1:End()
RETURN( NIL )
// --------------------------
STATIC FUNCTION W_ALPHA( hDC, oWnd )
LOCAL oBmp1
DEFINE BITMAP oBmp1 FILENAME "A_LOGO.BMP"
ABPaint( hDC, 20, 20, oBmp1:hBitmap, 220 )
RETURN NIL
[/code:bdd1r50g]
I tested this and the Alpha-BMP is painted inside the xBrowse,
but doesn't stay on screen ( just shown a second ) :
[code:bdd1r50g]
....
....
DEFINE BITMAP oBmp1 FILENAME "A_LOGO.BMP"
ACTIVATE DIALOG oDlg5 CENTERED ;
ON PAINT ( hDC := oBrw5:GETDC(), ;
oBrw5:SetBackGround( ABPaint( hDC, 20, 20, oBmp1:hBitmap, 220 ) ), ;
oBrw5:RELEASEDC() )
[/code:bdd1r50g]
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Alpha BMPs en toda la aplicacion...?
|
Holas a todos..
Una suposicion...
¿ Si solo quisiera usar ALPHABITMAPS en TODA mi aplicacion ( de hecho los BMP e Iconos que tengo pensado usar en un nuevo desarrollo solo son "Bitmaps with Alpha Channel" ), que cambios serian necesarios en las clases TBitmap, Timage, Tbutton etc etc ?
¿ O Solo reemplazar la llamada a DrawMasked por ABPAINT en algun .c ?
Los cambios de Giovany Vecchi a la tButtonBmp son geniales, la presentacion visual de la aplicacion es mucho mas PRO y moderna, los clientes estan mas acostumbrados a las transparencias, sombras, con VISTA y ahora con WINDOWS 7, pero no puedo replicarlos en la Toolbar, TRebar, TImage ....
Alguna idea.
|
Alpha BMPs en toda la aplicacion...?
|
Hola Mr.Adolfo,
También soy de la misma opinión. Estoy desarrollando una nueva aplicación y creo firmemente que la aplicación debe tener la contemporánea Vista, Windows 7 y no como en los viejos Windows'98 o Windows 2000. La estética del programa es muy importante. Con la ayuda de nuestro foro y he modificado TButtonBmp TBitmap para apoyar canal alfa, pero no han hecho nada sobre la TBtnBmp.
Con los cambios que tienen la opción de especificar si la BMP AlphaChannel está teniendo o no y, en consecuencia, la pintura sea el método utilizado. También he pedido a Mr.Antonio para incluir estos cambios. Antonio dice que está buscando una solución para que las clases se determinará si el BMP contiene AlphaChannel o no y, en consecuencia, llamar al método de la pintura. Pero sugiero que hasta nos encontramos con la detección automática que deberíamos tener la opción de decir que la programación contiene AlphaChannel o BMP y no cumplir el requisito.
Saludos
|
Alpha BMPs en toda la aplicacion...?
|
Adolfo, Answer,
See this thread in stackoverflow and lets check what is the final solution:
Veamos que solución se aporta en esta conversación:
[url:1lealmh0]http://stackoverflow.com/questions/685684/how-to-programmatically-detect-if-a-bitmap-has-alpha-channel[/url:1lealmh0]
|
Alpha Bitmap + Menu
|
Most objects that support bitmap already supports bitmaps with alpha channel as an example I can cite the RibbonBar I'm currently using, but if I use these bitmaps on the menu, a black border appears.
The menu does not support this type of bitmap?
|
Alpha Bitmaps on Button Bar
|
There is a problem with painting of some alpha bitmaps on buttonbars from version 9.04 onwards.
[url=http://img119.imageshack.us/i/alphabar.jpg/:2aw6fr51][img:2aw6fr51]http://img119.imageshack.us/img119/7072/alphabar.jpg[/img:2aw6fr51][/url:2aw6fr51]
[code=fw:2aw6fr51]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">'fivewin.ch'</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oBar<br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">'Alpha Bitmaps on Button Bar'</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTONBAR</span> oBar <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">64</span>,<span style="color: #000000;">64</span> <span style="color: #000000;">2007</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\u</span>p.bmp'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\d</span>own.bmp'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>lus.bmp'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\m</span>inus.bmp'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\p</span>hone.bmp'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\i</span>nfo.bmp'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\u</span>ser.bmp'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\w</span>orld.bmp'</span><br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #0000ff;">OF</span> oBar FILE <span style="color: #ff0000;">'<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\3</span>2x32<span style="color: #000000;">\i</span>nfo.bmp'</span><br /><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:2aw6fr51]
These buttonbars were working properly in earlier versions. Upgrading the application with latest FWH versions is producing unacceptable look.
Here is the screenshot of the same program in version 9.03
[url=http://img406.imageshack.us/i/alphabar.jpg/:2aw6fr51][img:2aw6fr51]http://img406.imageshack.us/img406/7072/alphabar.jpg[/img:2aw6fr51][/url:2aw6fr51]
Similar is the case with some bitmaps in XBrowse also. The problem basically observed with 'many' ( not all ) alpha bitmaps in 32x32 folder
Can this be fixed ?
|
Alpha Bitmaps on Button Bar
|
Buttons and Buttonbar are working with real Hight-Resolution-Alpha-Channel-BMP's now.
The Bitmaps ( Down, Minus, Plus, Up ) have Alpha-Channels, but doesn't work.
I exported them as < Premultiplied Alpha > and it worked.
For the Test, I converted the transparent Background of BMP < Down >.
It is easy and 100 % working, to change them with Pixelformer => Import / Export
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=3&t=15008&p=77576&hilit=pixelformer#p77576">viewtopic.php?f=3&t=15008&p=77576&hilit=pixelformer#p77576</a><!-- l -->
[img:x0v07krt]http://www.pflegeplus.com/pictures/Alphablend1.jpg[/img:x0v07krt]
A picture-viewer shows the original BMP < Down > transparent ( white Background )
[img:x0v07krt]http://www.pflegeplus.com/pictures/AlphaCon4.jpg[/img:x0v07krt]
The Result after Export, shows a transparent [color=#BF0000:x0v07krt]Black[/color:x0v07krt] Background
[img:x0v07krt]http://www.pflegeplus.com/pictures/AlphaCon3.jpg[/img:x0v07krt]
Choose < Import > to convert BMP < UP >( with checked background ) :
[img:x0v07krt]http://www.pflegeplus.com/pictures/AlphaCon1.jpg[/img:x0v07krt]
For Export, activate BMP-Format : < Premultipled Alpha >
[img:x0v07krt]http://www.pflegeplus.com/pictures/AlphaCon2.jpg[/img:x0v07krt]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Alpha Bitmaps on Button Bar
|
[quote:f5thc5l8]The Bitmaps ( Down, Minus, Plus, Up ) have Alpha-Channels, but doesn't work.
I exported them as < Premultiplied Alpha > and it worked.
[/quote:f5thc5l8]
That is the point. Most of the alpha bitmaps in the 32x32 folder are straight, not premultiplied alpha bitmaps and ABPaint works only with bitmaps with premultiplied alpha information.
Wish FWH provides these bitmaps converted as premultiplied, so that laymen like me can use them straight. Or still better ABpaint recognizes if the alpha is premultiplied or not and use appropriate painting algorithm. I am a novice in this area, but as a layman on the subject, I would like if this is provided by FW
|
Alpha Bitmaps on Button Bar
|
Mr Uwe
Thanks
I downloaded pixelformer and converted all these bmps. Now all work excellently with the new ABPaint() of FWH
|
Alpha Bitmaps on Button Bar
|
To make it complete, the LOGO-Solution and Button-Convert :
Painting a Alpha-Blended-BMP-Logo from any Image ( for Buttons, it is the same ).
( You don't need to know anything about Layers.
That makes it easy for more inexperienced Graphic-application users )
A normal JPG-Photo ( Angelina.jpg ) is used.
1. We have to define on < Image-Properties > from the Top, that we want to work on a transparent Image.
We select < RGB-Colors with Alpha-Channel >.
We use the Brush ( transparent ) and paint the Background of the Photo.
There is a Tool < Magic Wall >. It detects the borders of a Color to be filled with a transparent Brush.
Inside a Photo, there is no single Background-Color.
This Tool is useful, to fill a Button-Background ( transparent ), if just 1 Color is detected.
This way, the old Buttons with a defined Background-Color, can easely converted to Alpha-Blended BMP's.
The Transparent-Level can be adjusted with a Dbl-Click on the Transparent-Symbol.
[img:gmsbls24]http://www.pflegeplus.com/pictures/trans1.jpg[/img:gmsbls24]
2. We Export the Image as BMP with the < Premultiplied Alpha > Selection
[img:gmsbls24]http://www.pflegeplus.com/pictures/trans2.jpg[/img:gmsbls24]
3. The Result.
[img:gmsbls24]http://www.pflegeplus.com/pictures/trans3.jpg[/img:gmsbls24]
Changing a FWH-Button to Alpha-Blended BMP
1. We change the Propertie to Transparent
2. We set the transparent-level to 100 %
[img:gmsbls24]http://www.pflegeplus.com/pictures/trans4.jpg[/img:gmsbls24]
We use the < Magic wall > to select the purple area, we want to change to transparent.
We fill the area, using the bucket-tool.
[img:gmsbls24]http://www.pflegeplus.com/pictures/trans5.jpg[/img:gmsbls24]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Alpha Bitmaps on Button Bar
|
Uwe,
Many thanks for your tutorials. Really great <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Alpha Bmp não mostra corretamente
|
Olá Antonio,
Estou tentando usar um bmp-alpha em minha tela principal só que está aparecendo o fundo do bmp. Veja:
[img:2njq6h27]http://br.geocities.com/qiinformatica2000/alpha.PNG[/img:2njq6h27]
Aqui está os links para baixar os bmp´s:
[url:2njq6h27]http://br.geocities.com/qiinformatica2000/brick.bmp[/url:2njq6h27]
[url:2njq6h27]http://br.geocities.com/qiinformatica2000/lixeira.bmp[/url:2njq6h27]
E aqui o fonte para teste:
[code=fw:2njq6h27]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /> <br />*************<br /><span style="color: #00C800;">function</span> MAIN<br />*************<br /><br /><span style="color: #00C800;">local</span> oBrush, oWnd, oBmp<br /><br /><span style="color: #0000ff;">define</span> <span style="color: #0000ff;">brush</span> oBrush filename <span style="color: #ff0000;">"brick.bmp"</span><br /><br /><span style="color: #0000ff;">define</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">title</span> <span style="color: #ff0000;">"Teste de Alpha Chanels"</span> <span style="color: #0000ff;">BRUSH</span> oBrush<br /><br />SET <span style="color: #0000ff;">MESSAGE</span> <span style="color: #0000ff;">OF</span> oWnd <span style="color: #0000ff;">to</span> <span style="color: #ff0000;">""</span> NOINSET DATE CLOCK KEYBOARD <span style="color: #000000;">2007</span> <br /><br /><span style="color: #0000ff;">define</span> bitmap oBmp <span style="color: #0000ff;">of</span> oWnd filename <span style="color: #ff0000;">"lixeira.bmp"</span><br /><br />oWnd:<span style="color: #000000;">bPainted</span> := <span style="color: #000000;">{</span> | hDC | ABPaint<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">nWidth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> oBmp:<span style="color: #000000;">nWidth</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> oWnd:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> oBmp:<span style="color: #000000;">nHeight</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> / <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">50</span>, oBmp:<span style="color: #000000;">hBitmap</span>, <span style="color: #000000;">220</span> <span style="color: #000000;">)</span> <span style="color: #000000;">}</span><br /><br /><span style="color: #0000ff;">activate</span> <span style="color: #0000ff;">window</span> oWnd <span style="color: #0000ff;">MAXIMIZED</span><br /><br />oBmp:<span style="color: #000000;">end</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">NIL</span><br /> </div>[/code:2njq6h27]
|
Alpha Bmp não mostra corretamente
|
Rossine,
Normalmente eso debe a que el bitmap no esta bien creado con el canal alpha.
Prueba a usar:
FWH\bitmaps\AlphaBmp\trash.bmp
|
Alpha Bmp não mostra corretamente
|
Rossine,
Prueba este ejemplo, veras que el bitmap con canal alpha se muestra bien:
FWH\samples\TestAB.prg
|
Alpha Bmp não mostra corretamente
|
Sim Antonio, o problema estava com a imagem <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
|
Alpha Zero the new Chess Master
|
Alpha Zero: Learning from scratch. Only with the rules of the game. Then began to play using a Monte-Carlo algorithm, which uses random moves at first until a neural network begins to learn which are the most promising options.
It took only four hours to play against himself to synthesize the chess knowledge of a millennium, and reach a level where he not only surpassed humans but also the world champion of Computer analysis modules, Stockfish. <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: --> <!-- s:shock: --><img src="{SMILIES_PATH}/icon_eek.gif" alt=":shock:" title="Shocked" /><!-- s:shock: -->
[url:2ghvibs9]https://deepmind.com/blog/alphago-zero-learning-scratch/[/url:2ghvibs9]
[url:2ghvibs9]https://chess24.com/es/informate/noticias/el-nuevo-amo-del-ajedrez-alphazero[/url:2ghvibs9] Spanish
|
Alpha Zero the new Chess Master
|
Realmente impresionante, muchas gracias Biel <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[quote:1jt3fjqj]El algoritmo AlphaZero desarrollado por Google y DeepMind necesitó solo de cuatro horas de [b:1jt3fjqj]jugar contra sí mismo[/b:1jt3fjqj] para sintetizar el conocimiento ajedrecístico de un milenio y medio y alcanzar un nivel en el que no solo superó a los humanos sino también al campeón mundial de módulos de análisis[/quote:1jt3fjqj]
[quote:1jt3fjqj]Si llegamos a crear algún tipo de consciencia e inteligencia muy básicas —el significado real de la Inteligencia Artificial—, es posible que este enfoque de aprendizaje se transforme en la entidad más inteligente del universo conocido[/quote:1jt3fjqj]
|
Alpha Zero the new Chess Master
|
[url:dw8j9b3q]https://twitter.com/search?q=AlphaZero&src=typd[/url:dw8j9b3q]
[url:dw8j9b3q]https://youtu.be/yth1hXDfJ-g[/url:dw8j9b3q]
|
Alpha Zero the new Chess Master
|
[b:7v51ldf6]Self-Play with a General Reinforcement Learning Algorithm[/b:7v51ldf6]
[url:7v51ldf6]https://arxiv.org/pdf/1712.01815.pdf[/url:7v51ldf6]
|
Alpha Zero the new Chess Master
|
A deep change is coming... <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[url:1psdg0n4]https://youtu.be/tXlM99xPQC8[/url:1psdg0n4]
|
Alpha Zero the new Chess Master
|
I N C R E I B L E (con mayúscula)
|
Alpha-Blended-BMP => the easy way
|
Hello,
after testing many graphic-applications :
Photoshop, Gimp, Icofx, xNview and more, I found a new two step-solution,
also to understand and useful for non experienced graphic-users.
The tool is designed, to make it easy, to convert to a Image with a Alpha-Blended background.
A situation could be :
Painting some transparent areas in a existing normal BMP and convert to Alpha-Blended.
How to do this, I will describe / add the solution in this toppic.
Download [color=#FF0000:2x4pe8a2]Pixelformer[/color:2x4pe8a2] :
<!-- m --><a class="postlink" href="http://www.qualibyte.com/">http://www.qualibyte.com/</a><!-- m -->
The working-File : PNG-format with transparent-Background ( import )
[img:2x4pe8a2]http://www.pflegeplus.com/pictures/pixel1.jpg[/img:2x4pe8a2]
The Export Alpha-Blended-BMP-File
[img:2x4pe8a2]http://www.pflegeplus.com/pictures/pixel3.jpg[/img:2x4pe8a2]
After the given Export-BMP-Filename,
the Setting for Alpha-Blended-BMP ( automaticly detects the needed values for best results )
[img:2x4pe8a2]http://www.pflegeplus.com/pictures/pixel4.jpg[/img:2x4pe8a2]
The result : Alpha-Blended-BMP
Syntax for Alpha-Blended-BMP's to be used :
[color=#FF0000:2x4pe8a2].....
.....
DEFINE BITMAP oBmp FILENAME "LOGO.bmp"
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( ABPaint( hDC, 20, 20, oBmp:hBitmap, 220 ) )
.....
.....[/color:2x4pe8a2]
[img:2x4pe8a2]http://www.pflegeplus.com/pictures/pixel2.jpg[/img:2x4pe8a2]
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Alpha-Blended-BMP => the easy way
|
Uwe, this is free ?
|
Alpha-Blended-BMP => the easy way
|
Hello Silvio,
This application is [color=#FF0000:izel98ci]FREE [/color:izel98ci]of charge.
It works perfect and does exactly the things I need. All other applications are difficultly, to handle this.
The application is specially designed as solution for Alpha-Blending.
You can define transparentcy for BMP, JPG, PNG, TGA, ICO, CUR straight inside the loaded image.
I'm not sure, for how long it will be free of charge. It is the new Beta-release.
A sample from FWH\bitmaps\beach.bmp ( normal BMP ) converted to Alpha-Blended,
making a paper-effect. It is possible now, to make any normal BMP / JPG transparent.
Before, I converted to PNG at first, but now it works with a straight define of the Alpha-Channel
Select => Project => Image properties.
If You load a PNG-file, there is nothing to do, because the Alpha-Channel is defined already.
Download : Screenshot-selection < How to do it >
<!-- m --><a class="postlink" href="http://www.pflegeplus.com/fw_downloads/alpha.zip">http://www.pflegeplus.com/fw_downloads/alpha.zip</a><!-- m -->
1. Import the Image
2. Set Image properties
3. Select TRANSPARENT-color for the brush-tool from the color-picker.
4. Paint the borders / areas transparent with the brush-tool
or select the magic tool to choose a color to make transparent.
5. Save ( export ) as BMP like shown on top.
After loading the BMP-file, you have to change the format before painting, to get the Alpha-Channel
Project => Image properties
[img:izel98ci]http://www.pflegeplus.com/pictures/pixel8.jpg[/img:izel98ci]
The Result after export to BMP ( see : how to save on top )
[img:izel98ci]http://www.pflegeplus.com/pictures/pixel6.jpg[/img:izel98ci]
Saved as Alpha-Blended-BMP transparent
Some tools make it easy, to change a color to transparent
The magic-tool detects the area of a selected color
[img:izel98ci]http://www.pflegeplus.com/pictures/pixel9.jpg[/img:izel98ci]
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Alpha-Blended-BMP => the easy way
|
Hello,
after creating some hight-quality Alpha-Blended-BMP's
with very good results :
[color=#FF0000:11orpi3z]DEFINE BITMAP oBmp FILENAME "LOGO.bmp"
...
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON PAINT ( ABPaint( hDC, 20, 20, oBmp:hBitmap, 220 ) ) [/color:11orpi3z]
I tested with :
[color=#FF0000:11orpi3z]@ 10, 10 BITMAP oBmp1 FILENAME "LOGO.bmp" NOBORDER
oBmp:lTransparent := .T.
oBmp:Refresh()[/color:11orpi3z]
it doesn't display the BMP.
I changed the transparent area to black and there was no display.
Is there a difference of the used BMP-quality ( BMP 24 Bits for Alpha-Blending ) ?
Regards
Uwe <!-- s:roll: --><img src="{SMILIES_PATH}/icon_rolleyes.gif" alt=":roll:" title="Rolling Eyes" /><!-- s:roll: -->
|
Alpha-Blended-BMP => the easy way
|
Dear Mr.Uwe,
You need to modify the class TBitmap to call AbPaint in the Paint method. The same applies to TButtonBmp.
If you search for AlphaBmp you will find the details about the required modifications in those classes. A Data named lAlphaBmp is set to .T. to display AlphaBmp's. In the Method Paint based on the value of lAlphaBmp the required paint method is called ie either AbPaint or the default Paint
Regards
Anser
|
Alpha-Blended-BMP => the easy way
|
do you try with
[b:3jzipqls]LOCAL oBrush := TBrush():New("NULL",,,)[/b:3jzipqls]
@ 320, 15 BITMAP oApp:oLogoBmp FILENAME ".\bitmaps\LOGOSYST2.BMP" NOBORDER PIXEL OF oApp():oDlg
oApp:oLogoBmp:nClrPane := GetSysColor(3)
oApp:oLogoBmp:lTransparent := .t.
oApp:oLogoBmp:oBrush := [b:3jzipqls]oBrush[/b:3jzipqls]
oApp:oLogoBmp:oCursor:= oCursor
oApp:oLogoBmp:bLClicked := {|| GoWeb("www.rivamania.it")}
|
Alpha-Blended-BMP => the easy way
|
>A Data named lAlphaBmp is set to .T. to display AlphaBmp's.
It would nice if the program could automatically detect if the BMP was alpha and then use the correct paint method. Does anyone know how?
Regards,
James
|
Alpha-Blended-BMP => the easy way
|
James,
Lets check this thread in stackoverflow and lets see what is the final solution:
[url:2fdcpz4z]http://stackoverflow.com/questions/685684/how-to-programmatically-detect-if-a-bitmap-has-alpha-channel[/url:2fdcpz4z]
|
Alpha-Blended-BMP => the easy way
|
Antonio,
I don't understand it, but maybe this code will help:
<!-- m --><a class="postlink" href="http://stackoverflow.com/questions/333559/c-win32-how-to-get-the-alpha-channel-from-an-hbitmap">http://stackoverflow.com/questions/3335 ... an-hbitmap</a><!-- m -->
James
|
Alpha-Blended-BMP => the easy way
|
Here is a C++ class (free) that does all kinds of bitmap manipulation. Maybe it is useful.
<!-- m --><a class="postlink" href="http://www.codeproject.com/KB/graphics/CBitmapEx.aspx">http://www.codeproject.com/KB/graphics/CBitmapEx.aspx</a><!-- m -->
James
|
Alpha-Blended-BMP => the easy way
|
A first prototype, though still is not properly working. Feedback is welcome <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
test.prg
[code=fw:3h1xbn0p]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBmp<br /><br /> <span style="color: #B900B9;">// DEFINE BITMAP oBmp FILENAME "c:\fwh\bitmaps\about.bmp" // No alpha</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp FILENAME <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\A</span>lphaBmp<span style="color: #000000;">\t</span>rash.bmp"</span> <span style="color: #B900B9;">// with alpha</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> HasAlpha<span style="color: #000000;">(</span> oBmp:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <br /> oBmp:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> HASALPHA <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HBITMAP hBmp = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> HDC hDC = GetDC<span style="color: #000000;">(</span> GetDesktopWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> BITMAPINFO bmi; <br /> void * bits;<br /> unsigned long ul; <br /> BOOL bAlpha = <span style="color: #00C800;">FALSE</span>;<br /><br /> memset<span style="color: #000000;">(</span> &bmi, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">(</span> BITMAPINFO <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>; <br /> bmi.bmiHeader.biSize = sizeof<span style="color: #000000;">(</span> BITMAPINFOHEADER <span style="color: #000000;">)</span>; <br /><br /> GetDIBits<span style="color: #000000;">(</span> hDC, hBmp, <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span>, <span style="color: #00C800;">NULL</span>, &bmi, DIB_RGB_COLORS <span style="color: #000000;">)</span>; <br /><br /> <span style="color: #B900B9;">// hb_retnl( bmi.bmiHeader.biSize );</span><br /><br /> bits = hb_xgrab<span style="color: #000000;">(</span> bmi.bmiHeader.biSize <span style="color: #000000;">)</span>; <br /><br /> GetDIBits<span style="color: #000000;">(</span> hDC, hBmp, <span style="color: #000000;">0</span>, bmi.bmiHeader.biHeight, &bits, &bmi, DIB_RGB_COLORS <span style="color: #000000;">)</span>; <br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> ul = <span style="color: #000000;">0</span>; ul < bmi.bmiHeader.biSize; ul += <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> char * <span style="color: #000000;">)</span> bits <span style="color: #000000;">)</span><span style="color: #000000;">[</span> ul + <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> bAlpha = <span style="color: #00C800;">TRUE</span>; <br /><br /> hb_xfree<span style="color: #000000;">(</span> bits <span style="color: #000000;">)</span>;<br /><br /> ReleaseDC<span style="color: #000000;">(</span> GetDesktopWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, hDC <span style="color: #000000;">)</span>;<br /> <br /> hb_retl<span style="color: #000000;">(</span> bAlpha <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span> <br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:3h1xbn0p]
|
Alpha-Blended-BMP => the easy way
|
There was a bug in the code. Still it is not working properly:
test.prg
[code=fw:23vjt9t0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBmp<br /><br /> <span style="color: #B900B9;">// DEFINE BITMAP oBmp FILENAME "c:\fwh\bitmaps\about.bmp" // No alpha</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp FILENAME <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\A</span>lphaBmp<span style="color: #000000;">\t</span>rash.bmp"</span> <span style="color: #B900B9;">// with alpha</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> HasAlpha<span style="color: #000000;">(</span> oBmp:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <br /> oBmp:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> HASALPHA <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HBITMAP hBmp = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> HDC hDC = GetDC<span style="color: #000000;">(</span> GetDesktopWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> BITMAPINFO bmi; <br /> void * bits;<br /> unsigned long ul; <br /> BOOL bAlpha = <span style="color: #00C800;">FALSE</span>;<br /><br /> memset<span style="color: #000000;">(</span> &bmi, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">(</span> BITMAPINFO <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>; <br /> bmi.bmiHeader.biSize = sizeof<span style="color: #000000;">(</span> BITMAPINFOHEADER <span style="color: #000000;">)</span>; <br /><br /> GetDIBits<span style="color: #000000;">(</span> hDC, hBmp, <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span>, <span style="color: #00C800;">NULL</span>, &bmi, DIB_RGB_COLORS <span style="color: #000000;">)</span>; <br /><br /> bits = hb_xgrab<span style="color: #000000;">(</span> bmi.bmiHeader.biSizeImage <span style="color: #000000;">)</span>; <br /><br /> GetDIBits<span style="color: #000000;">(</span> hDC, hBmp, <span style="color: #000000;">0</span>, bmi.bmiHeader.biHeight, &bits, &bmi, DIB_RGB_COLORS <span style="color: #000000;">)</span>; <br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> ul = <span style="color: #000000;">0</span>; ul < bmi.bmiHeader.biSize; ul += <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> char * <span style="color: #000000;">)</span> bits <span style="color: #000000;">)</span><span style="color: #000000;">[</span> ul + <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> bAlpha = <span style="color: #00C800;">TRUE</span>; <br /><br /> hb_xfree<span style="color: #000000;">(</span> bits <span style="color: #000000;">)</span>;<br /><br /> ReleaseDC<span style="color: #000000;">(</span> GetDesktopWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, hDC <span style="color: #000000;">)</span>;<br /> <br /> hb_retl<span style="color: #000000;">(</span> bAlpha <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span> <br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:23vjt9t0]
|
Alpha-Blended-BMP => the easy way
|
Another bug fixed. Still no properly working:
test.prg
[code=fw:2yzsw0v6]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBmp<br /><br /> <span style="color: #B900B9;">// DEFINE BITMAP oBmp FILENAME "c:\fwh\bitmaps\about.bmp" // No alpha</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp FILENAME <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\A</span>lphaBmp<span style="color: #000000;">\e</span>xplorer.bmp"</span> <span style="color: #B900B9;">// with alpha</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> HasAlpha<span style="color: #000000;">(</span> oBmp:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <br /> oBmp:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> HASALPHA <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HBITMAP hBmp = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> HDC hDC = GetDC<span style="color: #000000;">(</span> GetDesktopWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> BITMAPINFO bmi; <br /> void * bits;<br /> unsigned long ul; <br /> BOOL bAlpha = <span style="color: #00C800;">FALSE</span>;<br /><br /> memset<span style="color: #000000;">(</span> &bmi, <span style="color: #000000;">0</span>, sizeof<span style="color: #000000;">(</span> BITMAPINFO <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>; <br /> bmi.bmiHeader.biSize = sizeof<span style="color: #000000;">(</span> BITMAPINFOHEADER <span style="color: #000000;">)</span>; <br /><br /> GetDIBits<span style="color: #000000;">(</span> hDC, hBmp, <span style="color: #000000;">0</span>, <span style="color: #000000;">1</span>, <span style="color: #00C800;">NULL</span>, &bmi, DIB_RGB_COLORS <span style="color: #000000;">)</span>; <br /><br /> bits = hb_xgrab<span style="color: #000000;">(</span> bmi.bmiHeader.biSizeImage <span style="color: #000000;">)</span>; <br /><br /> GetDIBits<span style="color: #000000;">(</span> hDC, hBmp, <span style="color: #000000;">0</span>, bmi.bmiHeader.biHeight, &bits, &bmi, DIB_RGB_COLORS <span style="color: #000000;">)</span>; <br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> ul = <span style="color: #000000;">0</span>; ul < bmi.bmiHeader.biSizeImage; ul += <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> char * <span style="color: #000000;">)</span> bits <span style="color: #000000;">)</span><span style="color: #000000;">[</span> ul + <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> bAlpha = <span style="color: #00C800;">TRUE</span>; <br /><br /> hb_xfree<span style="color: #000000;">(</span> bits <span style="color: #000000;">)</span>;<br /><br /> ReleaseDC<span style="color: #000000;">(</span> GetDesktopWindow<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, hDC <span style="color: #000000;">)</span>;<br /> <br /> hb_retl<span style="color: #000000;">(</span> bAlpha <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span> <br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:2yzsw0v6]
|
Alpha-Blended-BMP => the easy way
|
Dear Mr.Antonio,
Really appreciate your effort. <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
HasAlpha( oBmp:hBitmap ) is returning .F. eventhough the Bitmap c:\fwh\bitmaps\AlphaBmp\explorer.bmp contains AlphaChannel. Hope that we will be able to solve this bug very soon.
Regards
Anser
|
Alpha-Blended-BMP => the easy way
|
Lets see if we get an answer from the Microsoft GDI group:
<!-- m --><a class="postlink" href="http://groups.google.es/group/microsoft.public.win32.programmer.gdi/browse_thread/thread/155a0727604bf930?hl=es#">http://groups.google.es/group/microsoft ... 930?hl=es#</a><!-- m -->
Also in the FreeImage forum:
<!-- m --><a class="postlink" href="https://sourceforge.net/forum/forum.php?thread_id=3148220&forum_id=36111">https://sourceforge.net/forum/forum.php ... m_id=36111</a><!-- m -->
|
Alpha-Blended-BMP => the easy way
|
Got it !!! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Please add this function in FWH\source\winapi\dibbmp.c
[code=fw:3tm3x43g]<div class="fw" id="{CB}" style="font-family: monospace;"><br />CLIPPER HASALPHA<span style="color: #000000;">(</span> PARAMS <span style="color: #000000;">)</span> <span style="color: #B900B9;">// hBitmap --> lYesNo</span><br /><span style="color: #000000;">{</span><br /> HANDLE hDib = DibFromBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> _parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <br /> <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> _parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> BOOL bAlphaChannel = <span style="color: #00C800;">FALSE</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> LPBITMAPINFO lpbmi = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span>;<br /> unsigned char * uc = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi <span style="color: #000000;">)</span>;<br /> unsigned long ul;<br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> ul = <span style="color: #000000;">0</span>; ul < lpbmi->bmiHeader.biSizeImage; ul += <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> uc<span style="color: #000000;">[</span> ul + <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> bAlphaChannel = <span style="color: #00C800;">TRUE</span>; <br /><br /> GlobalUnlock<span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <br /> _retl<span style="color: #000000;">(</span> bAlphaChannel <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span> <br /> </div>[/code:3tm3x43g]
|
Alpha-Blended-BMP => the easy way
|
Here you have a self contained working example. I appreciate your feedback testing different bitmaps with/without alpha channel, thanks! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
test.prg
[code=fw:cpykpc99]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oBmp<br /><br /> <span style="color: #B900B9;">// DEFINE BITMAP oBmp FILENAME "c:\fwh\bitmaps\arrow.bmp" // No alpha</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp FILENAME <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps<span style="color: #000000;">\A</span>lphaBmp<span style="color: #000000;">\w</span>orld.bmp"</span> <span style="color: #B900B9;">// with alpha</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> HasAlpha<span style="color: #000000;">(</span> oBmp:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /> oBmp:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><br />WORD DibNumColors<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span>;<br />HANDLE DibFromBitmap<span style="color: #000000;">(</span> HBITMAP, DWORD, WORD, HPALETTE <span style="color: #000000;">)</span>;<br /><br /><span style="color: #00C800;">static</span> WORD PaletteSize<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> LPBITMAPINFOHEADER lpbi = <span style="color: #000000;">(</span> LPBITMAPINFOHEADER <span style="color: #000000;">)</span> <span style="color: #0000ff;">pv</span>;<br /> WORD NumColors = DibNumColors<span style="color: #000000;">(</span> lpbi <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lpbi->biSize == sizeof<span style="color: #000000;">(</span> BITMAPCOREHEADER <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBTRIPLE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #00C800;">else</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBQUAD <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> HASALPHA <span style="color: #000000;">)</span> <span style="color: #B900B9;">// hBitmap --> lYesNo</span><br /><span style="color: #000000;">{</span><br /> HANDLE hDib = DibFromBitmap<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <br /> <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> BOOL bAlphaChannel = <span style="color: #00C800;">FALSE</span>;<br /> <br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> LPBITMAPINFO lpbmi = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span>;<br /> unsigned char * uc = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi <span style="color: #000000;">)</span>;<br /> unsigned long ul;<br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> ul = <span style="color: #000000;">0</span>; ul < lpbmi->bmiHeader.biSizeImage; ul += <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> uc<span style="color: #000000;">[</span> ul + <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> bAlphaChannel = <span style="color: #00C800;">TRUE</span>; <br /><br /> GlobalUnlock<span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <br /> hb_retl<span style="color: #000000;">(</span> bAlphaChannel <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span> <br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:cpykpc99]
|
Alpha-Blended-BMP => the easy way
|
Congratulations that you finally got it.
Here is a small program using the above code to check all bitmap files in any selected folder and show which bitmaps have alpha channel and which do not.
[code=fw:3713dd5e]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FiveWin.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> cDir := cGetDir<span style="color: #000000;">(</span> <span style="color: #ff0000;">"Bitmap Directory"</span>, <span style="color: #ff0000;">"c:<span style="color: #000000;">\f</span>wh<span style="color: #000000;">\b</span>itmaps"</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">local</span> aDir, aAlpha := <span style="color: #000000;">{</span><span style="color: #000000;">}</span><br /> <span style="color: #00C800;">local</span> n, oBmp<br /><br /> aDir := Directory<span style="color: #000000;">(</span> cDir + <span style="color: #ff0000;">"<span style="color: #000000;">\*</span>.bmp"</span> <span style="color: #000000;">)</span><br /> aEval<span style="color: #000000;">(</span> aDir, <span style="color: #000000;">{</span> |a| AAdd<span style="color: #000000;">(</span> aAlpha, <span style="color: #000000;">{</span> cDir + <span style="color: #ff0000;">"<span style="color: #000000;">\"</span> + a[ 1 ], "</span>no alpha<span style="color: #ff0000;">" } ) } )<br /><br /> for n := 1 to Len( aAlpha )<br /> DEFINE BITMAP oBmp FILENAME aAlpha[ n ][ 1 ]<br /> if HasAlpha( oBmp:hBitmap )<br /> aAlpha[ n ][ 2 ] := "</span>HAS ALPHA<span style="color: #ff0000;">"<br /> endif<br /> oBmp:End()<br /> next n<br /> xbrowse( aAlpha, cDir )<br /><br /><br />return nil<br /><br /><br />#pragma BEGINDUMP<br /><br />#include <windows.h><br />#include <hbapi.h><br /><br />WORD DibNumColors( void * pv );<br />HANDLE DibFromBitmap( HBITMAP, DWORD, WORD, HPALETTE );<br /><br />static WORD PaletteSize( void * pv )<br />{<br /> LPBITMAPINFOHEADER lpbi = ( LPBITMAPINFOHEADER ) pv;<br /> WORD NumColors = DibNumColors( lpbi );<br /><br /> if( lpbi->biSize == sizeof( BITMAPCOREHEADER ) )<br /> return ( WORD )( NumColors * sizeof( RGBTRIPLE ) );<br /> else<br /> return ( WORD )( NumColors * sizeof( RGBQUAD ) );<br />}<br /><br />HB_FUNC( HASALPHA ) // hBitmap --> lYesNo<br />{<br /> HANDLE hDib = DibFromBitmap( ( HBITMAP ) hb_parnl( 1 ), 0, 0,<br /> ( HPALETTE ) hb_parnl( 2 ) );<br /> BOOL bAlphaChannel = FALSE;<br /><br /> if( hDib )<br /> {<br /> LPBITMAPINFO lpbmi = ( LPBITMAPINFO ) GlobalLock( hDib );<br /> unsigned char * uc = ( LPBYTE ) lpbmi + ( WORD ) lpbmi->bmiHeader.biSize + PaletteSize( lpbmi );<br /> unsigned long ul;<br /><br /> for( ul = 0; ul < lpbmi->bmiHeader.biSizeImage; ul += 4 )<br /> if( uc[ ul + 3 ] != 0 )<br /> bAlphaChannel = TRUE;<br /><br /> GlobalUnlock( hDib );<br /> }<br /><br /> hb_retl( bAlphaChannel );<br />}<br /><br /><br />#pragma ENDDUMP<br /><br /></span></div>[/code:3713dd5e]
Compile run and see the results in xbrowse for all bitmaps
|
Alpha-Blended-BMP => the easy way
|
We can optimize HasAlpha() this way:
for( ul = 0; ul < lpbmi->bmiHeader.biSizeImage && ! bAlphaChannel; ul += 4 )
so there is no need to step through the whole array of bytes, once we find one that matches what we are looking for <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Alpha-Blended-BMP => the easy way
|
Dear Mr.Antonio & Mr.Nageshwara Rao,
I have tested my Application's Images folder wich contains BMP's with and without AlphaChannels and the new function HasAlpha is working perfectly.
I tried to upload a screen snapshot using Imageshack but right now here unable to upload using ImageShack. Don't know the reason. After browsing the pic and click upload, ImageShack say's "no files uploaded"
Anyway HasAlpha is working perfectly
Regards
Anser
|
Alpha-Blended-BMP on Panel
|
Is it possible to paint a alpha-blended-bmp on a panel.
Best regards,
Otto
|
Alpha-Blended-BMP on Panel
|
Otto,
A possible Solution, how to do it ( My new VTitle-Painter will be finished in a short Time ) :
For placing the BMP(s), start with a BORDER
( Testalig.prg from FWH\samples\ )
VTitle -> TOP = 0, will be Bottom of Buttonbar
[img:xwx19p25]http://www.pflegeplus.com/pictures/panelbmp0.jpg[/img:xwx19p25]
Delete the BORDER ( Result )
[img:xwx19p25]http://www.pflegeplus.com/pictures/panelbmp1.jpg[/img:xwx19p25]
Add NOBORDER to the Title, after You are finished, with placing/adjust the BMP-Position inside the Panel.
function Main()
local oBar, oPanel, oLbx, oTabs
local cItem
DEFINE WINDOW oWnd TITLE "FiveWin Automatic Alignment capabilities"
DEFINE BUTTONBAR oBar _3D SIZE 33, 33 OF oWnd
DEFINE BUTTON OF oBar
DEFINE BUTTON OF oBar
#ifndef __XPP__
oPanel = TPanel():New()
#else
oPanel = TPanel():New():_New()
#endif
oWnd:oClient = oPanel // It is the client control of oWnd
@ 0, 0 LISTBOX oLbx VAR cItem ;
ITEMS { "One", "Two", "Three" } SIZE 200, 100 OF oPanel
oPanel:oLeft = oLbx
@ 4, 0 TABS oTabs PROMPT "&One", "&Two", "T&hree" OF oPanel
oPanel:oBottom = oTabs
SET MESSAGE OF oWnd ;
TO "This unique feature saves hours of work!" NOINSET
ACTIVATE WINDOW oWnd ;
ON INIT SHOW_ALPHA(oPanel)
return nil
// ----------------------------
FUNCTION SHOW_ALPHA(oPanel)
LOCAL oBar1
c_path := CURDRIVE() + ":\" + GETCURDIR()
oTextFont := TFont():New("Arial", ,-20,.F.,.T. , , , ,.T. )
@ 20, 250 TITLE oBar1 size 200, 120 of oPanel TRANSPARENT [color=#FF0000:xwx19p25]NOBORDER[/color:xwx19p25]
@ 5, 10 TITLETEXT OF oBar1 TEXT "Test" FONT oTextFont COLOR 128
@ 20, 0 TITLEIMG OF oBar1 BITMAP c_path + "\Images\format.bmp" SIZE 45, 45 REFLEX TRANSPARENT
@ 20, 60 TITLEIMG OF oBar1 BITMAP c_path + "\Images\format.bmp" SIZE 45, 45 REFLEX TRANSPARENT
@ 20, 120 TITLEIMG OF oBar1 BITMAP c_path + "\Images\format.bmp" SIZE 45, 45 REFLEX TRANSPARENT
RETURN ( NIL )
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Alpha-Blended-BMP on Panel
|
Hello Uwe,
thank you for your help.
Now I have bitmaps on the panel.
Best regards,
Otto
|
Alpha-Blended-BMP on Panel
|
Hello Uwe,
did you every measured the speed differences between alpha blended and simple bmps.
Maybe I am doing something wrong but it seems as a simple bmp is painting much quicker.
What is your experiences?
Best regards,
Otto
|
Alpha-Blended-BMP on Panel
|
I think this is normal and expected.
EMG
|
AlphaBitmap no carga desde Recursos FWH-12.07
|
Hola Antonio,
La versión FWH-12.07 no carga los AlphaBitmap sí éstos están incorporador en archivo RC (Compilados a Res con PellesC o WorkShop) y además se está usando una DLL con otros recursos tales como ventanas.
Adjunto ejemplo:
[code=fw:3u0w7csd]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><br /><span style="color: #00C800;">Function</span> Inicio<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /> SET RESOURCES <span style="color: #0000ff;">TO</span> <span style="color: #ff0000;">"PRUEBA.DLL"</span> <span style="color: #B900B9;">// *** Si se quita la DLL funciona ??????? ***</span><br /> AcercaDe<span style="color: #000000;">(</span><span style="color: #ff0000;">"Prueba001"</span>,<span style="color: #ff0000;">"versión 001"</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">(</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">)</span><br /><br /><br />Procedure AcercaDe<span style="color: #000000;">(</span>cAplica,cVersion<span style="color: #000000;">)</span><br /> <span style="color: #00C800;">LOCAL</span> oDlg, oBmp<br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">FROM</span> <span style="color: #000000;">0</span>,<span style="color: #000000;">0</span> <span style="color: #0000ff;">TO</span> <span style="color: #000000;">200</span>,<span style="color: #000000;">327</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">STYLE</span> nOR<span style="color: #000000;">(</span> WS_POPUP, WS_THICKFRAME,<span style="color: #000000;">4</span><span style="color: #000000;">)</span> <span style="color: #B900B9;">// TRANSPARENT</span><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"Android"</span><br /> @ <span style="color: #000000;">81</span>,<span style="color: #000000;">62</span> <span style="color: #0000ff;">BUTTON</span> <span style="color: #ff0000;">"OK"</span> <span style="color: #0000ff;">OF</span> oDlg <span style="color: #0000ff;">ACTION</span> oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #0000ff;">PIXEL</span> <span style="color: #0000ff;">SIZE</span> <span style="color: #000000;">40</span>,<span style="color: #000000;">12</span><br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">CENTERED</span> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> ABPaint<span style="color: #000000;">(</span>hDC,<span style="color: #000000;">100</span>,<span style="color: #000000;">10</span>, oBmp:<span style="color: #000000;">hBitmap</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /><span style="color: #00C800;">Return</span> </div>[/code:3u0w7csd]
Prueba1.RC
[code=fw:3u0w7csd]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#include</span> <windows.h><br /><span style="color: #00D7D7;">#include</span> <commctrl.h><br /><span style="color: #00D7D7;">#include</span> <richedit.h><br /><br />ANDROID BITMAP <span style="color: #ff0000;">"C:<span style="color: #000000;">\F</span>WH<span style="color: #000000;">\B</span>ITMAPS<span style="color: #000000;">\A</span>LPHABMP<span style="color: #000000;">\A</span>ndroid.bmp"</span><br /><span style="color: #000000;">1</span> MANIFEST <span style="color: #ff0000;">"themed.manifest"</span><br /> </div>[/code:3u0w7csd]
Esto ha funcionado [b:3u0w7csd]SIEMPRE[/b:3u0w7csd] sin ningún problema. Ahora, con la FWH-12.07 toca obligatoriamente incluírlos en la DLL. Si no usas la DLL te carga bien. Hay algún conflicto que los anula cuando están en RES y usas DLL. Por favor puedes revisar ?
Aquí el código completo, incluída la DLL : [url:3u0w7csd]http://www.mastersoft3000.com/publico/fivewin/fwh-12.07-fail01.zip[/url:3u0w7csd]
|
AlphaBlend ERROR IN FWC LIB ??????
|
ANTONIO, i HAVE THE 9.10 AND I HAVE THIS ERROR
Progetto: test, Ambiente: xHarbour:
[1]:Harbour.Exe test.prg /m /n0 /w1 /es1 /a /v /iC:\work\FWH\include /iC:\work\xHarbour\Include /oObj\test.c
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6633)
Copyright 1999-2010, <!-- m --><a class="postlink" href="http://www.xharbour.org">http://www.xharbour.org</a><!-- m --> <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->
Compiling 'test.prg'...
Lines 112, Functions/Procedures 8
Generating C source output to 'Obj\test.c'...
Done.
[1]:Bcc32.Exe -M -c -O2 -tW -v- -X -DHB_FM_STATISTICS_OFF -DHB_NO_DEFAULT_API_MACROS -DHB_NO_DEFAULT_STACK_MACROS -DHB_OS_WIN_32 -IC:\work\FWH\include -Ic:\work\BCC55\Include;C:\work\xHarbour\Include -nG:\BACKUP~1\discoD\WORK_A~1\errori\effetti\Obj test.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
test.c:
[1]:iLink32.Exe -Gn -aa -Tpe -s @test.bcl
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'AlphaBlend' referenced from C:\WORK\FWH\LIB\FIVEHC.LIB|BRUSHES
|
AlphaBlend ERROR IN FWC LIB ??????
|
Dear Mr.Silvio,
The Borland Lib msimg32.lib must be missing in your link file Make file.
[quote:1ugvlzm0]echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc[/quote:1ugvlzm0]
Regards
Anser
|
AlphaBlend ERROR IN FWC LIB ??????
|
THANKSSSSSS
|
AlphaBlend in Windows Mobile / WinCE
|
We have found that some versions of Windows Mobile support AlphaBlend().
In order to check if your Windows Mobile or Windows CE supports it, please build and run the following test. A zero means it is not supported
test.prg
[code=fw:1kpryw3w]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FWCE.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">(</span> Test<span style="color: #000000;">(</span><span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><br /><span style="color: #00D7D7;">#include</span> <hbapi.h><br /><span style="color: #00D7D7;">#include</span> <windows.h><br /><br />LPWSTR AnsiToWide<span style="color: #000000;">(</span> char * <span style="color: #000000;">)</span>;<br /><br />HMODULE GetProcAddressW<span style="color: #000000;">(</span> HMODULE, LPWSTR <span style="color: #000000;">)</span>;<br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> TEST <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> LPWSTR pW1 = AnsiToWide<span style="color: #000000;">(</span> <span style="color: #ff0000;">"coredll.dll"</span> <span style="color: #000000;">)</span>;<br /> LPWSTR pW2 = AnsiToWide<span style="color: #000000;">(</span> <span style="color: #ff0000;">"AlphaBlend"</span> <span style="color: #000000;">)</span>;<br /> HMODULE hDll = LoadLibrary<span style="color: #000000;">(</span> pW1 <span style="color: #000000;">)</span>;<br /><br /> hb_retnl<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> LONG <span style="color: #000000;">)</span> GetProcAddressW<span style="color: #000000;">(</span> hDll, pW2 <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><br /> hb_xfree<span style="color: #000000;">(</span> pW1 <span style="color: #000000;">)</span>;<br /> hb_xfree<span style="color: #000000;">(</span> pW2 <span style="color: #000000;">)</span>;<br /> FreeLibrary<span style="color: #000000;">(</span> hDll <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP<br /> </div>[/code:1kpryw3w]
|
AlphaBlend in Windows Mobile / WinCE
|
Finally we got AlphaBlend support no matter if it is not supported by Windows Mobile or WinCE ! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
FWPPC has FWH ABPaint() too <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
TestAB.prg
[code=fw:36qqcjgl]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"FWCE.ch"</span><br /><br /><span style="color: #00C800;">function</span> Main<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><br /> <span style="color: #00C800;">local</span> oWnd, oBmp, oBmp2<br /><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp FILENAME CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\T</span>rash.bmp"</span><br /><br /> <span style="color: #0000ff;">DEFINE</span> BITMAP oBmp2 FILENAME CurDir<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">"<span style="color: #000000;">\p</span>aper2.bmp"</span><br /> <br /> <span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">WINDOW</span> oWnd<br /> <br /> <span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">WINDOW</span> oWnd ;<br /> <span style="color: #0000ff;">ON</span> <span style="color: #0000ff;">PAINT</span> <span style="color: #000000;">(</span> DrawBitmap<span style="color: #000000;">(</span> hDC, oBmp2:<span style="color: #000000;">hBitmap</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>, ABPaint<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span>, oBmp:<span style="color: #000000;">hBitmap</span>, <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br /> </div>[/code:36qqcjgl]
In Windows Mobile:
[img:36qqcjgl]http://img13.imageshack.us/img13/8753/35298621.png[/img:36qqcjgl]
In Windows CE:
[img:36qqcjgl]http://img13.imageshack.us/img13/163/10541224.png[/img:36qqcjgl]
|
AlphaBlend in Windows Mobile / WinCE
|
Hello Antonio,
which version of FWPPC has ABPaint?
Best regards,
Otto
error LNK2001: unresolved external symbol HB_FUN_ABPAINT
|
AlphaBlend in Windows Mobile / WinCE
|
Otto,
We plan to publish a new FWPPC build that will include it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
In the meantime, we may provide you the required modules for you to test it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
AlphaBlend in Windows Mobile / WinCE
|
Antonio ,
I runned your functio to chech if my smathphone have alpphablend system.
the msginfo return a number:66410360.
If you my smarthphone support alpha blend system?
I think it depend if on our system is loaded microsoft compact framework or not.
On wm 5.0 (on another smarthphone Htc TNT I) there is a net cf 1.0 and the ceck function return 0.
On my smathphone (htc tnt II ) there is now net cf 3.5 and the chech return the number 66410360.
|
AlphaBlend in Windows Mobile / WinCE
|
Silvio,
FWPPC ABPaint() function runs on all Windows versions <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
It is a self contained C function, no need for Windows to support it.
|
AlphaBlend in Windows Mobile / WinCE
|
Hello Antonio:
[quote="Antonio Linares":j634yi0y]It is a self contained C function, no need for Windows to support it.[/quote:j634yi0y]
Would you please to send me the required files to test it ?, thanks in advance.
Best regards
Manuel Mercado
my email: manuelmercado @ prodigy.net.mx
|
AlphaBlend in Windows Mobile / WinCE
|
Antonio,
My fwppc not have ABPaint() function!
It is the same of fwh?
|
AlphaBlend in Windows Mobile / WinCE
|
This is the source code for ABPaint() for FWPPC:
[code=fw:23w2jgyf]<div class="fw" id="{CB}" style="font-family: monospace;"><br />BOOL AlphaBlendU<span style="color: #000000;">(</span> HDC dcDest, int x, int y, int cx, int cy,<br /> HDC dcSrc, int sx, int sy, int scx, int scy, int alpha <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> BITMAPINFOHEADER BMI;<br /> BYTE * pSrcBits;<br /> HBITMAP hbmSrc;<br /> BYTE * pDestBits;<br /> HBITMAP hbmDest;<br /> HDC dc;<br /> HBITMAP dcOld;<br /> int j, i;<br /><br /> <span style="color: #B900B9;">// Fill in the header info.</span><br /> BMI.biSize = sizeof<span style="color: #000000;">(</span>BITMAPINFOHEADER<span style="color: #000000;">)</span>;<br /> BMI.biWidth = cx;<br /> BMI.biHeight = cy;<br /> BMI.biPlanes = <span style="color: #000000;">1</span>;<br /> BMI.biBitCount = <span style="color: #000000;">32</span>;<br /> BMI.biCompression = BI_RGB; <span style="color: #B900B9;">// No compression</span><br /> BMI.biSizeImage = <span style="color: #000000;">0</span>;<br /> BMI.biXPelsPerMeter = <span style="color: #000000;">0</span>;<br /> BMI.biYPelsPerMeter = <span style="color: #000000;">0</span>;<br /> BMI.biClrUsed = <span style="color: #000000;">0</span>; <span style="color: #B900B9;">// Always use the whole palette.</span><br /> BMI.biClrImportant = <span style="color: #000000;">0</span>;<br /><br /> <span style="color: #B900B9;">// Create DIB section in shared memory</span><br /> hbmSrc = CreateDIBSection <span style="color: #000000;">(</span>dcSrc, <span style="color: #000000;">(</span>BITMAPINFO *<span style="color: #000000;">)</span>&BMI,<br /> DIB_RGB_COLORS, <span style="color: #000000;">(</span>void **<span style="color: #000000;">)</span>&pSrcBits, <span style="color: #000000;">0</span>, 0l<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">// Create DIB section in shared memory</span><br /> hbmDest = CreateDIBSection <span style="color: #000000;">(</span>dcDest, <span style="color: #000000;">(</span>BITMAPINFO *<span style="color: #000000;">)</span>&BMI,<br /> DIB_RGB_COLORS, <span style="color: #000000;">(</span>void **<span style="color: #000000;">)</span>&pDestBits, <span style="color: #000000;">0</span>, 0l<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">// Copy our source and destination bitmaps onto our DIBSections,</span><br /> <span style="color: #B900B9;">// so we can get access to their bits using the BYTE *'s we</span><br /> <span style="color: #B900B9;">// passed into CreateDIBSection</span><br /> dc = CreateCompatibleDC<span style="color: #000000;">(</span><span style="color: #00C800;">NULL</span><span style="color: #000000;">)</span>;<br /><br /> dcOld = <span style="color: #000000;">(</span>HBITMAP<span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span>dc, hbmSrc<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>!StretchBlt<span style="color: #000000;">(</span>dc, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, cx, cy, dcSrc, sx, sy,<br /> scx, scy, SRCCOPY<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">FALSE</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> dc, hbmDest <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> !StretchBlt<span style="color: #000000;">(</span> dc, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, cx, cy, dcDest, x, y, cx, cy, SRCCOPY <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">FALSE</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> dc, dcOld <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> dc <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> j = <span style="color: #000000;">0</span>; j < cy; ++j <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> LPBYTE pbDestRGB = <span style="color: #000000;">(</span>LPBYTE<span style="color: #000000;">)</span>&<span style="color: #000000;">(</span><span style="color: #000000;">(</span>DWORD*<span style="color: #000000;">)</span>pDestBits<span style="color: #000000;">)</span><span style="color: #000000;">[</span>j * cx<span style="color: #000000;">]</span>;<br /> LPBYTE pbSrcRGB = <span style="color: #000000;">(</span>LPBYTE<span style="color: #000000;">)</span>&<span style="color: #000000;">(</span><span style="color: #000000;">(</span>DWORD*<span style="color: #000000;">)</span>pSrcBits<span style="color: #000000;">)</span><span style="color: #000000;">[</span>j * cx<span style="color: #000000;">]</span>;<br /><br /> unsigned char a1, a2;<br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i = <span style="color: #000000;">0</span>; i < cx; ++i <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> a1 = pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> a1 != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> a1 = alpha * <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> a1 * <span style="color: #000000;">100</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">100</span>;<br /> a2 = <span style="color: #000000;">255</span> - a1;<br /><br /> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">0</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> pbDestRGB<span style="color: #000000;">[</span> <span style="color: #000000;">0</span> <span style="color: #000000;">]</span> * a2 <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">0</span> <span style="color: #000000;">]</span> * a1 <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> >> <span style="color: #000000;">8</span>;<br /> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> pbDestRGB<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> * a2 <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> * a1 <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> >> <span style="color: #000000;">8</span>;<br /> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> pbDestRGB<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> * a2 <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> * a1 <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> >> <span style="color: #000000;">8</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">0</span> <span style="color: #000000;">]</span> = pbDestRGB<span style="color: #000000;">[</span> <span style="color: #000000;">0</span> <span style="color: #000000;">]</span>;<br /> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = pbDestRGB<span style="color: #000000;">[</span> <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>;<br /> pbSrcRGB<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> = pbDestRGB<span style="color: #000000;">[</span> <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span><br /> pbSrcRGB += <span style="color: #000000;">4</span>;<br /> pbDestRGB += <span style="color: #000000;">4</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /><br /> dc = CreateCompatibleDC<span style="color: #000000;">(</span> <span style="color: #00C800;">NULL</span> <span style="color: #000000;">)</span>;<br /><br /> dcOld = <span style="color: #000000;">(</span>HBITMAP<span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span>dc, hbmSrc<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span> <span style="color: #000000;">(</span>!BitBlt<span style="color: #000000;">(</span>dcDest, x, y, cx, cy, dc, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, SRCCOPY<span style="color: #000000;">)</span><span style="color: #000000;">)</span><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">FALSE</span>;<br /><br /> DeleteDC<span style="color: #000000;">(</span>dc<span style="color: #000000;">)</span>;<br /> DeleteObject<span style="color: #000000;">(</span>hbmSrc<span style="color: #000000;">)</span>;<br /> DeleteObject<span style="color: #000000;">(</span>hbmDest<span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">return</span> <span style="color: #00C800;">TRUE</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> ABPAINT <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HDC hDC = <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /> HDC hDCComp = CreateCompatibleDC<span style="color: #000000;">(</span> hDC <span style="color: #000000;">)</span>;<br /> BITMAP bm;<br /> HGDIOBJ hOldBmp = SelectObject<span style="color: #000000;">(</span> hDCComp, <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><br /> GetObject<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, sizeof<span style="color: #000000;">(</span> BITMAP <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> LPSTR <span style="color: #000000;">)</span> &bm <span style="color: #000000;">)</span>;<br /> AlphaBlendU<span style="color: #000000;">(</span> hDC, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, bm.bmWidth, bm.bmHeight, hDCComp,<br /> <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, bm.bmWidth, bm.bmHeight, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> hDCComp, hOldBmp <span style="color: #000000;">)</span>;<br /> DeleteDC<span style="color: #000000;">(</span> hDCComp <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /> </div>[/code:23w2jgyf]
Example:
[code=fw:23w2jgyf]<div class="fw" id="{CB}" style="font-family: monospace;"><br />ABPaint<span style="color: #000000;">(</span> hDC, <span style="color: #000000;">10</span>, <span style="color: #000000;">10</span>, hBitmap, <span style="color: #000000;">200</span> <span style="color: #000000;">)</span><br /> </div>[/code:23w2jgyf]
screenshot using ABPaint() with FWPPC in Windows Mobile:
[img:23w2jgyf]http://img405.imageshack.us/img405/9905/capturel.jpg[/img:23w2jgyf]
|
AlphaBlend in Windows Mobile / WinCE
|
thanks Antonio.
Isee your sample picture...how you made these buttons?
|
AlphaBlend in Windows Mobile / WinCE
|
Silvio,
A graphics designer did them using photoshop
|
AlphaChannel BMP Problem!!!!
|
Hi everyone,
I have a little problem with this BMP:
[url:25nknsyr]http://www.mayapos.com/FiveWin/claudia.bmp[/url:25nknsyr]
Because when I activate AlphaChannel with Axialis IconWorkshop, It's shown like this:
[img:25nknsyr]http://www.mayapos.com/FiveWin/foto1.bmp[/img:25nknsyr]
I tried this code before converting the image to alpha channel:
[code=fw:25nknsyr]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">IMAGE</span> oImage FILE <span style="color: #ff0000;">'<span style="color: #000000;">\M</span>ayaPOS<span style="color: #000000;">\g</span>raficos<span style="color: #000000;">\C</span>amareros<span style="color: #000000;">\C</span>LAUDIA.bmp'</span> <br />msgalert<span style="color: #000000;">(</span> HasAlpha<span style="color: #000000;">(</span> oImage:<span style="color: #000000;">hBitmap</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> </div>[/code:25nknsyr]
And It returns .F.
I tried to convert it and show it with BtnBmp and with @X,Y IMAGE, Transparent and not Transparent, and it's the same...
After conversion, the image it's Ok if I open it with Paint or Axialis or Windows Image Viewer, what could be the problem???
|
AlphaChannel BMP Problem!!!!
|
Done some test, and I think it has to be something with the AlphaChannel class or functions, because I tried:
Save it with Paint
Save it with Axialis
Copy image from web page
and copy with print screen and paste it to Paint
It looks something color specific on this image... I don't supply the images to the costumer and it's imposibble to check every one, what can I do???
|
AlphaChannel BMP Problem!!!!
|
Hello Byron,
to display the Image, there is no Reason, to add a Alpha-channel,
but if You want to include it, You can use < [color=#FF0000:2t6k6gp0]Pixelformer[/color:2t6k6gp0] >
1. Menu [color=#0000FF:2t6k6gp0]File[/color:2t6k6gp0] => [color=#FF0000:2t6k6gp0]Import[/color:2t6k6gp0] ( Your Image )
2. Menu [color=#0000FF:2t6k6gp0]Image => Properties [/color:2t6k6gp0]=> [color=#FF0000:2t6k6gp0]change to RgbColor with Alphachannel ( 32bpp )[/color:2t6k6gp0]
3. Menu [color=#0000FF:2t6k6gp0]File => Export [/color:2t6k6gp0]( new Image-name )
4. activate in [color=#0000FF:2t6k6gp0]Dialog BMP-options [/color:2t6k6gp0]=> [color=#FF0000:2t6k6gp0]Premultiplied Alpha[/color:2t6k6gp0]
With this Program You will get the needed Result.
<!-- m --><a class="postlink" href="http://www.qualibyte.com/pixelformer/">http://www.qualibyte.com/pixelformer/</a><!-- m -->
[img:2t6k6gp0]http://www.pflegeplus.com/pictures/claudia.jpg[/img:2t6k6gp0]
The generated Source from the Screenshot above :
[code=fw:2t6k6gp0]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"fivewin.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"Image.ch"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"ttitle.ch"</span><br /><br /><span style="color: #00C800;">STATIC</span> oWnd<br /><br /><span style="color: #00C800;">FUNCTION</span> MAIN<span style="color: #000000;">(</span><span style="color: #000000;">)</span><br /><span style="color: #00C800;">LOCAL</span> oBtn1, oBtn2<br /><br />SET _3DLOOK <span style="color: #0000ff;">ON</span><br />SetBalloon<span style="color: #000000;">(</span> .T. <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Balloon shape required for tooltips</span><br /><br /><span style="color: #00C800;">PUBLIC</span> c_path := CURDRIVE<span style="color: #000000;">(</span><span style="color: #000000;">)</span> + <span style="color: #ff0000;">":<span style="color: #000000;">\"</span> + GETCURDIR() <br />PUBLIC nSWidth := GetSysMetrics(0), nSHeight := GetSysMetrics(1)<br />PUBLIC oSysfont1 := TFont():New( "</span>Arial<span style="color: #ff0000;">", 0, 16,.F.,.T., 0, 0, 0,.F.,.F.)<br />PUBLIC oHeadFont := TFont():New( "</span>Arial<span style="color: #ff0000;">",0 ,-22,.F.,.T.,0 ,0,0,.F.,.F.)<br />PUBLIC oTextFont := TFont():New( "</span>Arial<span style="color: #ff0000;">",0 ,-18,.F.,.T.,0 ,0,0,.F.,.F.)<br /><br />DEFINE WINDOW oWnd ;<br />FROM 30, 30 TO 500, 700 PIXEL TITLE "</span>Mesage and <span style="color: #0000ff;">xBrowse</span><span style="color: #ff0000;">"<br /><br />SHOW_MSG(oWnd) <br /><br />@ nSHeight - 160, nSWidth - 200 BTNBMP oBtn2 SIZE 150, 60 OF oWnd 2007 ;<br />FILENAME c_path + "</span>\<span style="color: #0000ff;">Bitmaps</span>\quit.bmp<span style="color: #ff0000;">" ;<br />LEFT ;<br />PROMPT "</span> &Exit <span style="color: #ff0000;">" ;<br />FONT oSysfont1 ;<br />ACTION oWnd:End()<br />oBtn2:lTransparent = .t.<br />oBtn2:cTooltip := { "</span>Close<span style="color: #ff0000;">" + CRLF + ;<br /> "</span>Message-test<span style="color: #ff0000;">","</span>Close <span style="color: #0000ff;">Window</span><span style="color: #ff0000;">", 1, CLR_BLACK, 14089979 }<br /><br />ACTIVATE WINDOW oWnd MAXIMIZED ;<br />ON INIT WND_BRUSH( oWnd, "</span>FANTASY3.JPG <span style="color: #ff0000;">" )<br /><br />oSysFont1:End()<br />CLOSE DATABASE<br /><br />RETURN NIL<br /><br />//-----------------<br /><br />FUNCTION WND_BRUSH( cControl, cImage )<br />LOCAL hDC, oBrush<br /><br />IF File( c_path + "</span>\<span style="color: #0000ff;">bitmaps</span>\<span style="color: #ff0000;">" + cImage )<br /> DEFINE BRUSH oBrush FILE c_path + "</span>\<span style="color: #0000ff;">Bitmaps</span>\<span style="color: #ff0000;">" + cImage<br /> SET BRUSH OF cControl TO oBrush<br /> RELEASE BRUSH oBrush<br />ELSE<br /> MsgAlert( "</span>Cannot load : <span style="color: #ff0000;">" + CRLF + ;<br /> c_path + "</span>\<span style="color: #0000ff;">bitmaps</span>\<span style="color: #ff0000;">" + cDImage, "</span>Error<span style="color: #ff0000;">" )<br />ENDIF<br /><br />RETURN NIL<br /><br />// ----------------------<br /><br />FUNCTION SHOW_MSG( oControl )<br />LOCAL oBar1<br /><br /><br />@ 60, 50 TITLE oBar1 SIZE 350, 250 OF oControl SHADOW BOTTOMRIGHT SHADOWSIZE 14<br /><br />@ 15, 140 TITLETEXT oTitle OF oBar1 TEXT "</span>About-<span style="color: #0000ff;">message</span><span style="color: #ff0000;">" FONT oHeadFont COLOR 65535<br /><br />@ 52, 140 TITLETEXT oText1 OF oBar1 TEXT "</span><span style="color: #00C800;">New</span> Line <span style="color: #000000;">1</span><span style="color: #ff0000;">" FONT oTextFont COLOR 16776960<br />@ 85, 140 TITLETEXT oText2 OF oBar1 TEXT "</span>Line <span style="color: #000000;">2</span><span style="color: #ff0000;">" FONT oTextFont COLOR 16776960<br /><br />@ 20, 20 TITLEIMG oBmp1 OF oBar1 BITMAP c_Path + "</span>\<span style="color: #0000ff;">Bitmaps</span>\CLAUDIA1.BMP<span style="color: #ff0000;">" SIZE 95, 120 ANIMA LEVEL 255 ;<br />ACTION ( NIL)<br /><br />oBar1:lRound := .T.<br />oBar1:lBorder := .T.<br />oBar1:nClrLine1 := 255<br /><br />IF FILE( c_Path + "</span>\<span style="color: #0000ff;">Bitmaps</span>\FANTASY1.JPG<span style="color: #ff0000;">" )<br /> oBar1:aGrdBack := {}<br /> DEFINE BRUSH oBrush FILENAME c_Path + "</span>\<span style="color: #0000ff;">Bitmaps</span>\FANTASY1.JPG<span style="color: #ff0000;">"<br /> SET BRUSH OF oBar1 TO oBrush:Resized( 350, 250, 1 )<br /> RELEASE BRUSH oBrush<br />ELSE<br /> MsgAlert( "</span>File : <span style="color: #000000;">FANTASY1</span>.JPG<span style="color: #ff0000;">" + CRLF + ;<br /> "</span>does not exist<span style="color: #ff0000;">" + CRLF + ; <br /> "</span><span style="color: #0000ff;">to</span> create <span style="color: #0000ff;">Brush</span> !<span style="color: #ff0000;">", "</span>ATTENTION<span style="color: #ff0000;">" ) <br />ENDIF<br /><br />@ 191, 291 BTNBMP oBtn OF oBar1 ;<br />SIZE 40, 45 PIXEL;<br />NOBORDER ;<br />PROMPT "</span>&OK<span style="color: #ff0000;">" ;<br />FILENAME c_path + "</span>\<span style="color: #0000ff;">Bitmaps</span>\Btn1.bmp<span style="color: #ff0000;">" ;<br />ACTION oWnd:End() ;<br />FONT oSysFont1 ;<br />CENTER<br />oBtn:lTransparent := .t.<br />oBtn:cToolTip = { "</span>Close <span style="color: #ff0000;">" + CRLF + "</span><span style="color: #0000ff;">Message</span><span style="color: #ff0000;">","</span><span style="color: #0000ff;">Message</span> End<span style="color: #ff0000;">", 1, CLR_BLACK, 14089979 }<br />oBtn:SetColor( 0, )<br /><br />RETURN( NIL )<br /></span></div>[/code:2t6k6gp0]
Best Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
AlphaChannel BMP Problem!!!!
|
Thanks Uwe, as usual all your sugestions are the best ones for me...
|
Alphablend Platform Independent Working !!!
|
Hi friends,
This is my first try of an AlphaBlend funtion that works on all windows version, and can be changed to work on linux too:
It is working but need be optmized for speed:
[code=fw:116dwkx1]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><br />WORD DibNumColors<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span>;<br /><br />HANDLE DibFromBitmap<span style="color: #000000;">(</span> HBITMAP, DWORD, WORD, HPALETTE <span style="color: #000000;">)</span>;<br /><br /><span style="color: #00C800;">static</span> WORD PaletteSize<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> LPBITMAPINFOHEADER lpbi = <span style="color: #000000;">(</span> LPBITMAPINFOHEADER <span style="color: #000000;">)</span> <span style="color: #0000ff;">pv</span>;<br /><br /> WORD NumColors = DibNumColors<span style="color: #000000;">(</span> lpbi <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lpbi->biSize == sizeof<span style="color: #000000;">(</span> BITMAPCOREHEADER <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBTRIPLE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBQUAD <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><br />void DrawNewAlpha<span style="color: #000000;">(</span> HDC hdc, HBITMAP hbm, int iRow, int iCol <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HANDLE hDib = DibFromBitmap<span style="color: #000000;">(</span> hbm, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> COLORREF clr;<br /><br /> int i, j;<br /><br /> BYTE r, g, b;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> LPBITMAPINFO lpbmi = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span>;<br /><br /> unsigned char * uc = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi <span style="color: #000000;">)</span>;<br /><br /> unsigned long ul = <span style="color: #000000;">3</span>, a1, a2;<br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> j = <span style="color: #000000;">0</span>; j < lpbmi->bmiHeader.biHeight; j++ <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i = <span style="color: #000000;">0</span>; i < lpbmi->bmiHeader.biWidth; i++ <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> a1 = uc<span style="color: #000000;">[</span> ul <span style="color: #000000;">]</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> a1 != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> a1 == <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> clr = RGB<span style="color: #000000;">(</span> uc<span style="color: #000000;">[</span> ul - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>, uc<span style="color: #000000;">[</span> ul - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>, uc<span style="color: #000000;">[</span> ul - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span>;<br /><br /> SetPixelV<span style="color: #000000;">(</span> hdc, i + iCol, lpbmi->bmiHeader.biHeight - j + iRow, clr <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> a2 = <span style="color: #000000;">255</span> - a1;<br /><br /> clr = GetPixel<span style="color: #000000;">(</span> hdc, i + iCol, lpbmi->bmiHeader.biHeight - j + iRow <span style="color: #000000;">)</span>;<br /><br /> b = clr / <span style="color: #000000;">65536</span>;<br /> g = clr / <span style="color: #000000;">256</span>;<br /> r = <span style="color: #000000;">(</span> clr - <span style="color: #000000;">(</span> b * <span style="color: #000000;">65536</span> <span style="color: #000000;">)</span> - <span style="color: #000000;">(</span> g * <span style="color: #000000;">256</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><br /> SetPixelV<span style="color: #000000;">(</span> hdc, i + iCol, lpbmi->bmiHeader.biHeight - j + iRow, RGB<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> a1 * uc<span style="color: #000000;">[</span> ul - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> a2 * r <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">255</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> a1 * uc<span style="color: #000000;">[</span> ul - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> a2 * g <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">255</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> a1 * uc<span style="color: #000000;">[</span> ul - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> a2 * b <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /><br /> ul += <span style="color: #000000;">4</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /><br /> GlobalUnlock<span style="color: #000000;">(</span> hDib <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><br /> hb_retl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> NEWALPHABLEND <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> DrawNewAlpha<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:116dwkx1]
To test:
[code=fw:116dwkx1]<div class="fw" id="{CB}" style="font-family: monospace;"> <span style="color: #00C800;">local</span> hBmp := LoadBitmap<span style="color: #000000;">(</span>GetResources<span style="color: #000000;">(</span><span style="color: #000000;">)</span>, <span style="color: #000000;">7777</span> <span style="color: #000000;">)</span><br /> NewAlphaBlend<span style="color: #000000;">(</span> oDlg:<span style="color: #000000;">GetDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span>, hBmp, <span style="color: #000000;">40</span>, <span style="color: #000000;">40</span> <span style="color: #000000;">)</span><br /> oDlg:<span style="color: #000000;">ReleaseDC</span><span style="color: #000000;">(</span><span style="color: #000000;">)</span></div>[/code:116dwkx1]
Regards,
Toninho.
|
Alphablend Platform Independent Working !!!
|
Toninho,
GetPixel() and SetPixel() are quite slow, you should avoid them.
To improve the speed, you have to directly access the array of bytes of the bitmap.
Please review this DrDobbs article <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> AlphaBlendU()
<!-- m --><a class="postlink" href="http://www.ddj.com/windows/184416353?pgno=21">http://www.ddj.com/windows/184416353?pgno=21</a><!-- m -->
The Alpha Channel is not used in such code. It has to be modified to use it.
|
Alphablend Platform Independent Working !!!
|
[quote="Antonio Linares":2gh0wplv]Toninho,
GetPixel() and SetPixel() are quite slow, you should avoid them.
To improve the speed, you have to directly access the array of bytes of the bitmap.
[/quote:2gh0wplv]
Hi Antonio. Thanks. I know it. As I say, it is my first try.
[quote="Antonio Linares":2gh0wplv]
Please review this DrDobbs article <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> AlphaBlendU()
<!-- m --><a class="postlink" href="http://www.ddj.com/windows/184416353?pgno=21">http://www.ddj.com/windows/184416353?pgno=21</a><!-- m -->
The Alpha Channel is not used in such code. It has to be modified to use it.[/quote:2gh0wplv]
Thanks for the hint. I´ll try implement Alpha Channel in its code.
Regards,
Toninho.
|
Alphablend Platform Independent Working !!!
|
Toninho,
> I´ll try implement Alpha Channel in its code.
I have tried it and I have it partially working.
If you want to I can share my changes so we can work together to get it properly working <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Alphablend Platform Independent Working !!!
|
Toninho,
The fourth byte keeps the alpha channel amount. These are my changes. They are working but the alpha level is not taken into account. We need to improve it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
[code=fw:1ws3rz8e]<div class="fw" id="{CB}" style="font-family: monospace;"><br />...<br /><span style="color: #00C800;">for</span> <span style="color: #000000;">(</span> i = <span style="color: #000000;">0</span>; i < cx; ++i<span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #B900B9;">// Alpha value</span><br /> <span style="color: #000000;">{</span><br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span>=<span style="color: #000000;">(</span>pbDestRGB<span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span> * <span style="color: #000000;">(</span> alpha - pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> + <span style="color: #B900B9;">// (255-alpha) +</span><br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span> * <span style="color: #000000;">(</span> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> >><span style="color: #000000;">8</span>; <span style="color: #B900B9;">// alpha</span><br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>=<span style="color: #000000;">(</span>pbDestRGB<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> * <span style="color: #000000;">(</span> alpha - pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> + <span style="color: #B900B9;">// (255-alpha) +</span><br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> * <span style="color: #000000;">(</span> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> >><span style="color: #000000;">8</span>;<br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>=<span style="color: #000000;">(</span>pbDestRGB<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> * <span style="color: #000000;">(</span> alpha - pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> + <span style="color: #B900B9;">// (255-alpha) +</span><br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> * <span style="color: #000000;">(</span> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">3</span><span style="color: #000000;">]</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span> >><span style="color: #000000;">8</span>;<br /> <span style="color: #000000;">}</span> <br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span> = pbDestRGB<span style="color: #000000;">[</span><span style="color: #000000;">0</span><span style="color: #000000;">]</span>;<br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span> = pbDestRGB<span style="color: #000000;">[</span><span style="color: #000000;">1</span><span style="color: #000000;">]</span>;<br /> pbSrcRGB<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span> = pbDestRGB<span style="color: #000000;">[</span><span style="color: #000000;">2</span><span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span> <br /> pbSrcRGB += <span style="color: #000000;">4</span>;<br /> pbDestRGB += <span style="color: #000000;">4</span>;<br /> <span style="color: #000000;">}</span><br />...<br /> </div>[/code:1ws3rz8e]
|
Alphablend Platform Independent Working !!!
|
Hi Antonio.
Done !!!!!!!!!!!!! In another way:
[code=fw:2ry0xmsp]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br />WORD DibNumColors<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span>;<br /><br />HPALETTE CreateDIBPalette<span style="color: #000000;">(</span> HGLOBAL hDIB <span style="color: #000000;">)</span>;<br /><br />HANDLE DibFromBitmap<span style="color: #000000;">(</span> HBITMAP, DWORD, WORD, HPALETTE <span style="color: #000000;">)</span>;<br /><br />BOOL DibDraw<span style="color: #000000;">(</span> HDC hDC, HGLOBAL hDib, WORD wCol, WORD wRow, HPALETTE hPalette, WORD wWidth, WORD wHeight, DWORD dwRop <span style="color: #000000;">)</span>;<br /><br /><span style="color: #00C800;">static</span> WORD PaletteSize<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> LPBITMAPINFOHEADER lpbi = <span style="color: #000000;">(</span> LPBITMAPINFOHEADER <span style="color: #000000;">)</span> <span style="color: #0000ff;">pv</span>;<br /><br /> WORD NumColors = DibNumColors<span style="color: #000000;">(</span> lpbi <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lpbi->biSize == sizeof<span style="color: #000000;">(</span> BITMAPCOREHEADER <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBTRIPLE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBQUAD <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br />void DrawNewAlpha<span style="color: #000000;">(</span> HDC hDC1, HBITMAP hBitmap1, int iRow, int iCol <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HDC hDC2;<br /><br /> HANDLE hDib1, hDib2;<br /><br /> unsigned char * uc1;<br /> unsigned char * uc2;<br /><br /> unsigned long a1, a2;<br /><br /> unsigned int i1;<br /><br /> LPBITMAPINFO lpbmi1, lpbmi2;<br /><br /> HBITMAP hBitmap2, hBmpOld;<br /><br /> BITMAP bm;<br /><br /> hDC2 = CreateCompatibleDC<span style="color: #000000;">(</span> hDC1 <span style="color: #000000;">)</span>;<br /><br /> GetObject<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HGDIOBJ <span style="color: #000000;">)</span> hBitmap1, sizeof<span style="color: #000000;">(</span> BITMAP <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> LPSTR <span style="color: #000000;">)</span> &bm <span style="color: #000000;">)</span>;<br /><br /> hBitmap2 = CreateCompatibleBitmap<span style="color: #000000;">(</span> hDC1, bm.bmWidth, bm.bmHeight <span style="color: #000000;">)</span>;<br /><br /> hBmpOld = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> hDC2, hBitmap2 <span style="color: #000000;">)</span>;<br /><br /> BitBlt<span style="color: #000000;">(</span> hDC2, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, bm.bmWidth, bm.bmHeight, hDC1, iCol, iRow, SRCCOPY <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> hDib1 = DibFromBitmap<span style="color: #000000;">(</span> hBitmap1, <span style="color: #000000;">0</span>, <span style="color: #000000;">32</span>, <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /> hDib2 = DibFromBitmap<span style="color: #000000;">(</span> hBitmap2, <span style="color: #000000;">0</span>, <span style="color: #000000;">32</span>, <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> lpbmi1 = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> lpbmi2 = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /><br /> uc1 = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi1 + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi1->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi1 <span style="color: #000000;">)</span>;<br /> uc2 = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi2 + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi2->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi2 <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i1 = <span style="color: #000000;">3</span>; i1 <= lpbmi1->bmiHeader.biSizeImage; i1 += <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> a1 = uc1<span style="color: #000000;">[</span> i1 <span style="color: #000000;">]</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> a1 != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> a1 == <span style="color: #000000;">255</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> = uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span>;<br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> = uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span>;<br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> a2 = <span style="color: #000000;">255</span> - a1;<br /><br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> a1 * uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> + a2 * uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">255</span>;<br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> a1 * uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> + a2 * uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">255</span>;<br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> a1 * uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> + a2 * uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">255</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /><br /> DibDraw<span style="color: #000000;">(</span> hDC1, hDib2, iCol, iRow, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> GlobalUnlock<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> GlobalUnlock<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> hDC2, hBmpOld <span style="color: #000000;">)</span>;<br /><br /> DeleteObject<span style="color: #000000;">(</span> hBitmap2 <span style="color: #000000;">)</span>;<br /><br /> DeleteDC<span style="color: #000000;">(</span> hDC2 <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> NEWALPHABLEND <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> DrawNewAlpha<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:2ry0xmsp]
Regards,
Toninho.
|
Alphablend Platform Independent Working !!!
|
Toninho,
You have to free the hDibs memory:
[code=fw:2c0lb07o]<div class="fw" id="{CB}" style="font-family: monospace;"><br /> GlobalUnlock<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> GlobalUnlock<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /> GlobalFree<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>; <span style="color: #B900B9;">// new</span><br /> GlobalFree<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>; <span style="color: #B900B9;">// new</span><br /> </div>[/code:2c0lb07o]
Your code works fine but it does not uses an AlphaBlend transparency level. i.e.:
NEWALPHABLEND( hDC, hBitmap, nRow, nCol, nSourceConstantAlpha )
where nSourceConstantAlpha is in the range 0, 255.
From Microsoft docs:
[quote:2c0lb07o]
SourceConstantAlpha
Specifies an alpha transparency value to be used on the entire source bitmap. The SourceConstantAlpha value is combined with any per-pixel alpha values in the source bitmap. If you set SourceConstantAlpha to 0, it is assumed that your image is transparent. When you only want to use per-pixel alpha values, set the SourceConstantAlpha value to 255 (opaque) .
[/quote:2c0lb07o]
|
Alphablend Platform Independent Working !!!
|
Hey Antonio, you are fast ! <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Here is the code:
[code=fw:2w6n8n9t]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br />WORD DibNumColors<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span>;<br /><br />HPALETTE CreateDIBPalette<span style="color: #000000;">(</span> HGLOBAL hDIB <span style="color: #000000;">)</span>;<br /><br />HANDLE DibFromBitmap<span style="color: #000000;">(</span> HBITMAP, DWORD, WORD, HPALETTE <span style="color: #000000;">)</span>;<br /><br />BOOL DibDraw<span style="color: #000000;">(</span> HDC hDC, HGLOBAL hDib, WORD wCol, WORD wRow, HPALETTE hPalette, WORD wWidth, WORD wHeight, DWORD dwRop <span style="color: #000000;">)</span>;<br /><br /><span style="color: #00C800;">static</span> WORD PaletteSize<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> LPBITMAPINFOHEADER lpbi = <span style="color: #000000;">(</span> LPBITMAPINFOHEADER <span style="color: #000000;">)</span> <span style="color: #0000ff;">pv</span>;<br /><br /> WORD NumColors = DibNumColors<span style="color: #000000;">(</span> lpbi <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lpbi->biSize == sizeof<span style="color: #000000;">(</span> BITMAPCOREHEADER <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBTRIPLE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBQUAD <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br />void DrawNewAlpha<span style="color: #000000;">(</span> HDC hDC1, HBITMAP hBitmap1, int iRow, int iCol, int alpha <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HDC hDC2;<br /><br /> HANDLE hDib1, hDib2;<br /><br /> unsigned char * uc1;<br /> unsigned char * uc2;<br /><br /> unsigned long a1, a2;<br /><br /> unsigned int i1;<br /><br /> LPBITMAPINFO lpbmi1, lpbmi2;<br /><br /> HBITMAP hBitmap2, hBmpOld;<br /><br /> BITMAP bm;<br /><br /> hDC2 = CreateCompatibleDC<span style="color: #000000;">(</span> hDC1 <span style="color: #000000;">)</span>;<br /><br /> GetObject<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HGDIOBJ <span style="color: #000000;">)</span> hBitmap1, sizeof<span style="color: #000000;">(</span> BITMAP <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> LPSTR <span style="color: #000000;">)</span> &bm <span style="color: #000000;">)</span>;<br /><br /> hBitmap2 = CreateCompatibleBitmap<span style="color: #000000;">(</span> hDC1, bm.bmWidth, bm.bmHeight <span style="color: #000000;">)</span>;<br /><br /> hBmpOld = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> hDC2, hBitmap2 <span style="color: #000000;">)</span>;<br /><br /> BitBlt<span style="color: #000000;">(</span> hDC2, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, bm.bmWidth, bm.bmHeight, hDC1, iCol, iRow, SRCCOPY <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> hDib1 = DibFromBitmap<span style="color: #000000;">(</span> hBitmap1, <span style="color: #000000;">0</span>, <span style="color: #000000;">32</span>, <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /> hDib2 = DibFromBitmap<span style="color: #000000;">(</span> hBitmap2, <span style="color: #000000;">0</span>, <span style="color: #000000;">32</span>, <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> lpbmi1 = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> lpbmi2 = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /><br /> uc1 = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi1 + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi1->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi1 <span style="color: #000000;">)</span>;<br /> uc2 = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi2 + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi2->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi2 <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> alpha = <span style="color: #000000;">255</span> - alpha;<br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i1 = <span style="color: #000000;">3</span>; i1 <= lpbmi1->bmiHeader.biSizeImage; i1 += <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> a1 = uc1<span style="color: #000000;">[</span> i1 <span style="color: #000000;">]</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> a1 != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> a2 = <span style="color: #000000;">255</span> + alpha - uc1<span style="color: #000000;">[</span> i1 <span style="color: #000000;">]</span>;<br /><br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> a1 * uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> + a2 * uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">(</span> <span style="color: #000000;">255</span> + alpha <span style="color: #000000;">)</span>;<br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> a1 * uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> + a2 * uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">(</span> <span style="color: #000000;">255</span> + alpha <span style="color: #000000;">)</span>;<br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> a1 * uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> + a2 * uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">(</span> <span style="color: #000000;">255</span> + alpha <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /><br /> DibDraw<span style="color: #000000;">(</span> hDC1, hDib2, iCol, iRow, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> GlobalUnlock<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> GlobalUnlock<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /><br /> GlobalFree<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> GlobalFree<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> hDC2, hBmpOld <span style="color: #000000;">)</span>;<br /><br /> DeleteObject<span style="color: #000000;">(</span> hBitmap2 <span style="color: #000000;">)</span>;<br /><br /> DeleteDC<span style="color: #000000;">(</span> hDC2 <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> NEWALPHABLEND <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> DrawNewAlpha<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">55</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:2w6n8n9t]
The last param of DrawNewAlpha() accept valus from 0 to 255. 255 is full and 0 is transparent.
Regards,
Toninho.
|
Alphablend Platform Independent Working !!!
|
Toninho,
It is getting better <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
I would use:
[code=fw:lqasuy43]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> NEWALPHABLEND <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> DrawNewAlpha<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /> </div>[/code:lqasuy43]
Anyhow if you use a zero alpha value, the bitmap should not be seen. With your code, still it is seen.
I think that you are quite close to have it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
|
Alphablend Platform Independent Working !!!
|
[quote="Antonio Linares":d1t303hs]Toninho,
It is getting better <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Anyhow if you use a zero alpha value, the bitmap should not be seen. With your code, still it is seen.
I think that you are quite close to have it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:d1t303hs]
Antonio, Thanks.
I´ll see it tonight and post here.
But I´m trying to use crestostr() without success, can you please review this FWH function? I´m trying in this way:
? Len( cResToStr( 7777, 2 ) ) // 7777 is my resource, 2 is RT_BITMAP
Regards,
Toninho.
|
Alphablend Platform Independent Working !!!
|
Toninho,
> ? Len( cResToStr( 7777, 2 ) ) // 7777 is my resource, 2 is RT_BITMAP
Actually cResToStr() expects a string as the second parameter:
? Len( cResToStr( 7777, "BITMAP" ) )
We have to modify cResToStr() to accept numbers also.
|
Alphablend Platform Independent Working !!!
|
[quote="Antonio Linares":2n3n4kbv]Toninho,
It is getting better <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Anyhow if you use a zero alpha value, the bitmap should not be seen. With your code, still it is seen.
I think that you are quite close to have it <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->[/quote:2n3n4kbv]
DONE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[code=fw:2n3n4kbv]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #B900B9;">// Alphablend platform independent</span><br /><span style="color: #B900B9;">// works in all windows versions</span><br /><span style="color: #B900B9;">// <!-- e --><a href="mailto:Toninho@fwi.com.br">Toninho@fwi.com.br</a><!-- e --></span><br /><span style="color: #B900B9;">// Ver 1.05 - Apr 2009</span><br /><br /><span style="color: #00D7D7;">#pragma</span> BEGINDUMP<br /><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"windows.h"</span><br /><span style="color: #00D7D7;">#include</span> <span style="color: #ff0000;">"hbapi.h"</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br />WORD DibNumColors<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span>;<br /><br />HPALETTE CreateDIBPalette<span style="color: #000000;">(</span> HGLOBAL hDIB <span style="color: #000000;">)</span>;<br /><br />HANDLE DibFromBitmap<span style="color: #000000;">(</span> HBITMAP, DWORD, WORD, HPALETTE <span style="color: #000000;">)</span>;<br /><br />BOOL DibDraw<span style="color: #000000;">(</span> HDC hDC, HGLOBAL hDib, WORD wCol, WORD wRow, HPALETTE hPalette, WORD wWidth, WORD wHeight, DWORD dwRop <span style="color: #000000;">)</span>;<br /><br /><span style="color: #00C800;">static</span> WORD PaletteSize<span style="color: #000000;">(</span> void * <span style="color: #0000ff;">pv</span> <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> LPBITMAPINFOHEADER lpbi = <span style="color: #000000;">(</span> LPBITMAPINFOHEADER <span style="color: #000000;">)</span> <span style="color: #0000ff;">pv</span>;<br /><br /> WORD NumColors = DibNumColors<span style="color: #000000;">(</span> lpbi <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> lpbi->biSize == sizeof<span style="color: #000000;">(</span> BITMAPCOREHEADER <span style="color: #000000;">)</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBTRIPLE <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /> <span style="color: #00C800;">else</span><br /> <span style="color: #000000;">{</span><br /> <span style="color: #00C800;">return</span> <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span><span style="color: #000000;">(</span> NumColors * sizeof<span style="color: #000000;">(</span> RGBQUAD <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /> <span style="color: #000000;">}</span><br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br />void DrawNewAlpha<span style="color: #000000;">(</span> HDC hDC1, HBITMAP hBitmap1, int iRow, int iCol, int alpha <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> HDC hDC2;<br /><br /> HANDLE hDib1, hDib2;<br /><br /> unsigned char * uc1;<br /> unsigned char * uc2;<br /><br /> unsigned long a1, a2;<br /><br /> unsigned int i1;<br /><br /> LPBITMAPINFO lpbmi1, lpbmi2;<br /><br /> HBITMAP hBitmap2, hBmpOld;<br /><br /> BITMAP bm;<br /><br /> hDC2 = CreateCompatibleDC<span style="color: #000000;">(</span> hDC1 <span style="color: #000000;">)</span>;<br /><br /> GetObject<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HGDIOBJ <span style="color: #000000;">)</span> hBitmap1, sizeof<span style="color: #000000;">(</span> BITMAP <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> LPSTR <span style="color: #000000;">)</span> &bm <span style="color: #000000;">)</span>;<br /><br /> hBitmap2 = CreateCompatibleBitmap<span style="color: #000000;">(</span> hDC1, bm.bmWidth, bm.bmHeight <span style="color: #000000;">)</span>;<br /><br /> hBmpOld = <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> SelectObject<span style="color: #000000;">(</span> hDC2, hBitmap2 <span style="color: #000000;">)</span>;<br /><br /> BitBlt<span style="color: #000000;">(</span> hDC2, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, bm.bmWidth, bm.bmHeight, hDC1, iCol, iRow, SRCCOPY <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> hDib1 = DibFromBitmap<span style="color: #000000;">(</span> hBitmap1, <span style="color: #000000;">0</span>, <span style="color: #000000;">32</span>, <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /> hDib2 = DibFromBitmap<span style="color: #000000;">(</span> hBitmap2, <span style="color: #000000;">0</span>, <span style="color: #000000;">32</span>, <span style="color: #000000;">(</span> HPALETTE <span style="color: #000000;">)</span> <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> lpbmi1 = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> lpbmi2 = <span style="color: #000000;">(</span> LPBITMAPINFO <span style="color: #000000;">)</span> GlobalLock<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /><br /> uc1 = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi1 + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi1->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi1 <span style="color: #000000;">)</span>;<br /> uc2 = <span style="color: #000000;">(</span> LPBYTE <span style="color: #000000;">)</span> lpbmi2 + <span style="color: #000000;">(</span> WORD <span style="color: #000000;">)</span> lpbmi2->bmiHeader.biSize + PaletteSize<span style="color: #000000;">(</span> lpbmi2 <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> <span style="color: #00C800;">for</span><span style="color: #000000;">(</span> i1 = <span style="color: #000000;">3</span>; i1 <= lpbmi1->bmiHeader.biSizeImage; i1 += <span style="color: #000000;">4</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> a1 = uc1<span style="color: #000000;">[</span> i1 <span style="color: #000000;">]</span>;<br /><br /> <span style="color: #00C800;">if</span><span style="color: #000000;">(</span> a1 != <span style="color: #000000;">0</span> <span style="color: #000000;">)</span><br /> <span style="color: #000000;">{</span><br /> a1 = alpha * <span style="color: #000000;">(</span> <span style="color: #000000;">(</span> uc1<span style="color: #000000;">[</span> i1 <span style="color: #000000;">]</span> * <span style="color: #000000;">100</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">255</span> <span style="color: #000000;">)</span> / <span style="color: #000000;">100</span>;<br /><br /> a2 = <span style="color: #000000;">255</span> - a1;<br /><br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> * a1 <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">3</span> <span style="color: #000000;">]</span> * a2 <span style="color: #000000;">)</span> >> <span style="color: #000000;">8</span>;<br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> * a1 <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">2</span> <span style="color: #000000;">]</span> * a2 <span style="color: #000000;">)</span> >> <span style="color: #000000;">8</span>;<br /> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> = <span style="color: #000000;">(</span> uc1<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> * a1 <span style="color: #000000;">)</span> + <span style="color: #000000;">(</span> uc2<span style="color: #000000;">[</span> i1 - <span style="color: #000000;">1</span> <span style="color: #000000;">]</span> * a2 <span style="color: #000000;">)</span> >> <span style="color: #000000;">8</span>;<br /><br /> <span style="color: #000000;">}</span><br /> <span style="color: #000000;">}</span><br /><br /> DibDraw<span style="color: #000000;">(</span> hDC1, hDib2, iCol, iRow, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span>, <span style="color: #000000;">0</span> <span style="color: #000000;">)</span>;<br /><br /> <span style="color: #B900B9;">//---------------------------------------------------------------------------------------------------------------//</span><br /><br /> GlobalUnlock<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> GlobalUnlock<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /><br /> GlobalFree<span style="color: #000000;">(</span> hDib1 <span style="color: #000000;">)</span>;<br /> GlobalFree<span style="color: #000000;">(</span> hDib2 <span style="color: #000000;">)</span>;<br /><br /> SelectObject<span style="color: #000000;">(</span> hDC2, hBmpOld <span style="color: #000000;">)</span>;<br /><br /> DeleteObject<span style="color: #000000;">(</span> hBitmap2 <span style="color: #000000;">)</span>;<br /><br /> DeleteDC<span style="color: #000000;">(</span> hDC2 <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00C800;">HB_FUNC</span><span style="color: #000000;">(</span> NEWALPHABLEND <span style="color: #000000;">)</span><br /><span style="color: #000000;">{</span><br /> DrawNewAlpha<span style="color: #000000;">(</span> <span style="color: #000000;">(</span> HDC <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">1</span> <span style="color: #000000;">)</span>, <span style="color: #000000;">(</span> HBITMAP <span style="color: #000000;">)</span> hb_parnl<span style="color: #000000;">(</span> <span style="color: #000000;">2</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">3</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">4</span> <span style="color: #000000;">)</span>, hb_parni<span style="color: #000000;">(</span> <span style="color: #000000;">5</span> <span style="color: #000000;">)</span> <span style="color: #000000;">)</span>;<br /><span style="color: #000000;">}</span><br /><br /><span style="color: #B900B9;">//------------------------------------------------------------------------------------------------------------------//</span><br /><br /><span style="color: #00D7D7;">#pragma</span> ENDDUMP</div>[/code:2n3n4kbv]
Regards,
Toninho.
|
Alphablend Platform Independent Working !!!
|
Toninho,
Very good! <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
Congratulations!
|
Alphablend Platform Independent Working !!!
|
Toninho...
Great... thanks for your efforts...
I'll try it right away..
From Chile
Adolfo
|
Alphablended-BMP
|
HOw Create a Alphablended-BMP from a normal bmp?
|
Alphablended-BMP
|
[quote:2167lou5]May 2008
========
* New: AlphaBlending transparencies support for FiveWin! Please review samples\TestAB.prg for a working sample. In bitmaps\AlphaBmp\*.bmp there are several bitmaps with alpha channel. Please review this video to learn how to build bitmaps with alpha channel:
<!-- m --><a class="postlink" href="http://www.dailymotion.com/fivetech/video/8852204">http://www.dailymotion.com/fivetech/video/8852204</a><!-- m --> [/quote:2167lou5]
<!-- l --><a class="postlink-local" href="http://forums.fivetechsupport.com/viewtopic.php?f=17&t=13192&start=0">viewtopic.php?f=17&t=13192&start=0</a><!-- l -->
|
Alphablended-BMP
|
Hello Silvio,
to convert a BMP to Alpha-Blended-BMP doesn't make sense.
Basicly You have to use / convert a PNG-file ( with Shadows, Transparent-areas )
to a Alpha-Blended-BMP. A PNG-file contains LAYERS. The Layer of the transparent-area
of a PNG-file is converted to BLACK during saving as BMP.
Using a normal BMP ( with no separated transparent-areas ),there is nothing to convert.
You can convert a PNG-file to BMP-Alphablended easily with a normal Graphic-application
like < GIMP > or < XNVIEW >.
Load the PNG-file and save it a Alpha-Blended-BMP.
If You need some spezial PNG's, Just tell me, what You need ( motive / color ).
I have a big collection of all kind and sizes of PNG's.
Regards
Uwe <!-- s:lol: --><img src="{SMILIES_PATH}/icon_lol.gif" alt=":lol:" title="Laughing" /><!-- s:lol: -->
|
Alquien Le ha pasado Esto
|
Ruben...
ese problema fue correjido para esa version...
intenta usar este patch: [url:1igcid5c]http://forums.fivetechsupport.com/viewtopic.php?p=112262#p112262[/url:1igcid5c]
|
Alquien Le ha pasado Esto
|
Todas las pantallas me aparece al final de titulo un simbolo. Uso Pelles Windows XP
[img]
<!-- m --><a class="postlink" href="http://imageshack.us/photo/my-images/148/error3y.jpg/">http://imageshack.us/photo/my-images/148/error3y.jpg/</a><!-- m -->
[/img]
Ser Imagen
[img]
<!-- m --><a class="postlink" href="http://imageshack.us/photo/my-images/268/error2u.jpg/">http://imageshack.us/photo/my-images/268/error2u.jpg/</a><!-- m -->
[/img]
|
Alquien Le ha pasado Esto
|
Ruben
que version de fivewin estas usando?
|
Alquien Le ha pasado Esto
|
[quote="Daniel Garcia-Gil":2gq7cafh]Ruben
que version de fivewin estas usando?[/quote:2gq7cafh]
La 11.03
|
Alquien Le ha pasado Esto
|
[quote="Daniel Garcia-Gil":1wu74d1z]Ruben...
ese problema fue correjido para esa version...
intenta usar este patch: [url:1wu74d1z]http://forums.fivetechsupport.com/viewtopic.php?p=112262#p112262[/url:1wu74d1z][/quote:1wu74d1z]
Gracias , Voy a Probarlo
|
Alquien Le ha pasado Esto
|
[quote="Daniel Garcia-Gil":1d74up4y]Ruben...
ese problema fue correjido para esa version...
intenta usar este patch: [url:1d74up4y]http://forums.fivetechsupport.com/viewtopic.php?p=112262#p112262[/url:1d74up4y][/quote:1d74up4y]
Funciona pero me le quita la ultima lectra al texto.
Codigo lo escribe como Codig
[img]
<!-- m --><a class="postlink" href="http://imageshack.us/photo/my-images/219/error4.jpg/">http://imageshack.us/photo/my-images/219/error4.jpg/</a><!-- m -->
[/img]
|
Alquien Le ha pasado Esto
|
Ruben,...
es raro, pq ese patch evita justamente que suceda eso... verifica que lo estes agregrando antes de las librerias de fivewin
|
Alquien Le ha pasado Esto
|
[size=85:tjd6df7v][quote="ruben Dario":tjd6df7v]Funciona pero me le quita la ultima lectra al texto.[/quote:tjd6df7v][/size:tjd6df7v]
Y si le añades un ESPACIO al final de cada texto, será eso lo que quite ¿no?
|
Alquien Le ha pasado Esto
|
[quote="JmGarcia":1482on6q][size=85:1482on6q][quote="ruben Dario":1482on6q]Funciona pero me le quita la ultima lectra al texto.[/quote:1482on6q][/size:1482on6q]
Y si le añades un ESPACIO al final de cada texto, será eso lo que quite ¿no?[/quote:1482on6q]
Creo que no es la solucion , en realidad tengo muchas pantallas.
|
Alquien esta Usando MariaDB el reemplazo de Mysql
|
Alquien esta Usando MariaDB el reemplazo de Mysql, ya que tengo entendido compro a Mysql y desde el 2015 deja de ser gratuito.
|
Alquien esta Usando MariaDB el reemplazo de Mysql
|
Hice unas pruebs y funciona bien,,, aun sigo usando MySQL,pero segun el autor, MariaDB es "compatible" con MySQL,,,,
Salu2
|
Alquien esta Usando MariaDB el reemplazo de Mysql
|
La ultima version de MARIADB 5.2.5 es 1000% compatible con todo lo de MYSQL 5.5.11 GA ( COmmunity server)
Sean Conectores, Odbc, apis etc etc.
Saludos
Revisa aqui...
<!-- m --><a class="postlink" href="http://kb.askmonty.org/v/mariadb-versus-mysql-compatibility">http://kb.askmonty.org/v/mariadb-versus ... patibility</a><!-- m -->
Desde Chile
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.