Annonces Google
Serveur IRC
Serveur : irc.portlane.se
Canal : #AmigaNG
Activité du Site

Pages vues depuis 25/07/2007 : 25 347 173

  • Nb. de membres 187
  • Nb. d'articles 1 270
  • Nb. de forums 19
  • Nb. de sujets 20
  • Nb. de critiques 24

Top 10  Statistiques

Index du forum »»  Création-Développement »» Datatype, Bitmap et canal Alpha : ReadPixelArray ?

Datatype, Bitmap et canal Alpha : ReadPixelArray ?#1514

3Contributeur(s)
zzd10hthellierAmiDARK
3 Modérateur(s)
K-LElwoodcorto
thellier thelliericon_post
Je prefere le 2) car je sais pas trop ce que fais le 1)
je sais pas si on peut redimensionner ainsi alors fais un test en creant ta bitmap
de la taille de ton image a charger

Alain
zzd10h zzd10hicon_post
Merci beaucoup Alain,
c'était bien la remise à l'échelle qui posait problème.

avec scaling KO :
http://zzd10h.amiga-ng.org/Divers/Alpha_Scale.jpg

sans scaling OK :
http://zzd10h.amiga-ng.org/Divers/Alpha_NoScale.jpg

Ca ne m'arrange pas mais je pourrais au moins les afficher en taille réélle.

Merci beaucoup pour ton aide et ton exemple ;)
Trop fort !!!

Si ça intérésse qq'un, voila comment affichier un png alpha dans un Bitmap MUI.

http://zzd10h.amiga-ng.org/Divers/Alpha_Code_OK.txt

if(DoMethod(dtype, DTM_PROCLAYOUT, NULL, 1))
{
res = GetDTAttrs(dtype,
PDTA_DestBitMap, &bitmap_vignette,
PDTA_BitMapHeader, (ULONG)&bmhd,
TAG_DONE);

lock = p96LockBitMap(bitmap_vignette,(UBYTE*)&renderInfo, sizeof(renderInfo));
srcBytesPerRow = p96GetBitMapAttr(bitmap_vignette, P96BMA_BYTESPERROW);

IDoMethod(dtype,
PDTM_READPIXELARRAY,
renderInfo.Memory,
PBPAFMT_ARGB,
srcBytesPerRow,
0,
0,
bmh->bmh_Width,
bmh->bmh_Height);

p96UnlockBitMap(bitmap_vignette, lock);
SetAttrs(Im_Data_bmp, MUIA_Bitmap_Alpha,0xFFFFFFFF, MUIA_Bitmap_Transparent,0,MUIA_Bitmap_Width, bmh->bmh_Width,MUIA_Bitmap_Height, bmh->bmh_Height, MUIA_Bitmap_Bitmap, bitmap_vignette, TAG_DONE);
}
thellier thelliericon_post
Tu peut utiliser le compositing comme dans aminet/clonewindow pour faire une copie dune grosse bitmap vers une petite et donc generer tes "preview" et ce avec meme le filtering :-)

je peut pas t aider plus car j ai pas d amiga la

Alain
AmiDARK AmiDARKicon_post
Il serait sympa que quelqu'un qui ma?trise un peu le sujet puisse faire un jeu d'exemples couvrant ces domaines là :

- Ouverture d'une fenêtre
- Ouverture d'un écran (mode plein-écran)
- Chargement d'une image
- Affichage d'une image dans l'écran
- Copie d'un écran à un autre...

ça ferait de bons exemples pour aider à commencer le développement sous AmigaOS4 ;)

@+
zzd10h zzd10hicon_post
Alain :
Tu es une mine d'or graphique :=!

AmiDark :
Il y a déjà la plupart sur

http://www.gurumed.net/index.php/Les_datatypes

Non ?


Message édité par : zzd10h / 03-04-2013 19:59
AmiDARK AmiDARKicon_post
Effectivement :)
Je n'avais pas vu cet article là :)

Merci :)
zzd10h zzd10hicon_post
AmiDark :
Merci à Corto ;)

Thellier :
Super, un grand merci, ça marche !!!
j'ai mes couches Alpha même aprés remise à l'échelle grâce à CompositeTags

http://zzd10h.amiga-ng.org/Divers/Alpha_Scale_OK.jpg

Il y a un super exemple de CompositeTags sur
http://www.os4coding.net/forum/trouble-switching-pdtmscale-compositetags

dstbm = p96AllocBitMap( width_alpha_scaled, height_alpha_scaled, 32, BMF_DISPLAYABLE, bitmap_vignette, RGBFB_A8R8G8B8 );

error = CompositeTags(COMPOSITE_Src_Over_Dest,
bitmap_vignette,dstbm,
COMPTAG_ScaleX, COMP_FLOAT_TO_FIX(scale),
COMPTAG_ScaleY, COMP_FLOAT_TO_FIX(scale),
COMPTAG_Flags, flags ,
TAG_DONE);


if (!error == COMPERR_Success)
{
SetAttrs(Im_Data_bmp, MUIA_Bitmap_Alpha,0xFFFFFFFF, MUIA_Bitmap_Transparent,0,MUIA_Bitmap_Width, width_alpha_scaled,MUIA_Bitmap_Height, height_alpha_scaled, MUIA_Bitmap_Bitmap, dstbm, TAG_DONE);
}
thellier thelliericon_post
Parfait :-)

je pense que le meilleur operateur est COMPOSITE_Src pour cet usage

Alain
zzd10h zzd10hicon_post
Merci Alain,
j'essaye ce soir ;)
zzd10h zzd10hicon_post

Juste pour info, Alain,
COMPOSITE_Src ne semble pas marcher avec les couches alpha.
J'ai remis COMPOSITE_Src_Over_Dest,

Dans l'image ci-desous:

http://zzd10h.amiga-ng.org/Divers/Alpha_SrcOverDest.jpg

En bas = image dans Multiview
A gauche = avec COMPOSITE_Src_Over_Dest
A droite = avec COMPOSITE_Src

Je reste avec COMPOSITE_Src_Over_Dest :-P


error = CompositeTags(COMPOSITE_Src_Over_Dest,
bitmap_vignette,bitmap_vignette_copy,
COMPTAG_ScaleX, COMP_FLOAT_TO_FIX(scale),
COMPTAG_ScaleY, COMP_FLOAT_TO_FIX(scale),
COMPTAG_Flags, flags ,
TAG_DONE);
Petites Annonces

0 annonce(s) publiée(s)

Consulter

AmigaOS 4.1

Laissez-vous tenter par
AmigaOS 4.1
AmiTheme

AmiTheme