Précédent   Forum du club des développeurs et IT Pro > Autres langages > Pascal > Flash Pascal
Flash Pascal Forum d'entraide sur la création de fichiers Flash en Object Pascal
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 04/11/2012, 18h06   #1
Archimède
Membre émérite
 
Avatar de Archimède
 
Homme anthony
Enseignant
Inscription : avril 2005
Messages : 1 021
Détails du profil
Informations personnelles :
Nom : Homme anthony
Localisation : France, Charente Maritime (Poitou Charente)

Informations professionnelles :
Activité : Enseignant
Secteur : Enseignement

Informations forums :
Inscription : avril 2005
Messages : 1 021
Points : 973
Points : 973
Par défaut Synthèse de couleurs par superposition de movieclip

Hello, il y aurait peut-être une propriété qui gère la superposition de couleur dans un movieclip, je ne l'ai pas trouvée.. ?

faire une synthèse soustractive ou additive de couleurs par superposition.
Mise à part la propriété _alpha qui n'est pas satisfaisante...

ci-joint un essai en soustractif non concluant (pas de noir au centre)

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
program Project7;
 
{$FRAME_WIDTH 550}
{$FRAME_HEIGHT 400}
{$FRAME_RATE 12}
{$BACKGROUND $f0f0f0}
 
uses
  Flash8;
 
type
 diapo=class(movieclip)
  private
   procedure Roundrect(x,y,w,h,radius:number);
  public
   constructor create(aowner:movieclip;taille,couleur:integer);
 end;
 
 scene=class(movieclip)
  cyan,magenta,jaune:diapo;
  constructor create;
 end;
 
 
constructor scene.create;
begin
 inherited create(_root,'scene',0);
 
 Cyan:=diapo.create(self,200,$00ffff);
 with cyan do
 begin
  _x:=300;
  _y:=200;
 end;
 
 jaune:=diapo.create(self,200,$ffff00);
 with jaune do
 begin
  _x:=350;
  _y:=250;
 end;
 
 magenta:=diapo.create(self,200,$ff00ff);
 with magenta do
 begin
  _x:=400;
  _y:=150;
 end;
end;
 
constructor diapo.create(aowner:movieclip;taille,couleur:integer);
begin
 inherited create(aowner,'diapo', aowner.getNextHighestDepth());
 _alpha:=50;
 beginfill($FFFDD0);
 Linestyle(4,clblack);
 roundrect(-taille/2,-taille/2,taille,taille,30);
 endFill();
 beginfill(couleur);
 roundrect(-taille/2.5,-taille/2.5,2*taille/2.5,2*taille/2.5,30);
end;
 
procedure diapo.Roundrect(x,y,w,h,radius:number);
var
 ra,b:number;
begin
  ra := x + w;
  b := y + h;
  moveTo(x+radius, y);
  lineTo(ra-radius, y);
  CurveTo(ra,y, ra, y+radius);
  lineTo(ra, y+h-radius);
  CurveTo(ra, b, ra-radius, b);
  lineTo(x+radius, b);
  CurveTo(x, b,x, b-radius);
  lineTo(x, y+radius);
  CurveTo(x, y, x+radius,y);
end;
 
 
begin
  scene.create;
end.
Je viens d'avoir une idée... peut-être avec les matrices et bitmapdata ?

ou blendmode ?
__________________
Citation:
tout développeur plongé dans son code subit une poussée d'urticaire de bas en haut égale au poids du volume d'unités qu'il ajoute.
Archimède est actuellement connecté   Envoyer un message privé Réponse avec citation 00
Vieux 04/11/2012, 22h10   #2
Archimède
Membre émérite
 
Avatar de Archimède
 
Homme anthony
Enseignant
Inscription : avril 2005
Messages : 1 021
Détails du profil
Informations personnelles :
Nom : Homme anthony
Localisation : France, Charente Maritime (Poitou Charente)

Informations professionnelles :
Activité : Enseignant
Secteur : Enseignement

Informations forums :
Inscription : avril 2005
Messages : 1 021
Points : 973
Points : 973
A la place de _alpha... :
Code :
1
2
 
 blendmode:='multiply';
Et le tour est joué pour du soustractif...

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
 
program Project7;
 
{$FRAME_WIDTH 550}
{$FRAME_HEIGHT 400}
{$FRAME_RATE 12}
{$BACKGROUND $ffffff}
 
uses
  Flash8;
 
type
 diapo=class(movieclip)
  private
   procedure Roundrect(x,y,w,h,radius:number);
  public
   constructor create(aowner:movieclip;taille,couleur:integer);
 end;
 
 scene=class(movieclip)
  cyan,magenta,jaune:diapo;
  constructor create;
 end;
 
 
constructor scene.create;
begin
 inherited create(_root,'scene',0);
 
 Cyan:=diapo.create(self,300,$00ffff);
 with cyan do
 begin
  _x:=300;
  _y:=200;
 end;
 
 jaune:=diapo.create(self,300,$ffff00);
 with jaune do
 begin
  _x:=350;
  _y:=250;
 end;
 
 magenta:=diapo.create(self,300,$ff00ff);
 with magenta do
 begin
  _x:=400;
  _y:=150;
 end;
end;
 
constructor diapo.create(aowner:movieclip;taille,couleur:integer);
begin
 inherited create(aowner,'diapo', aowner.getNextHighestDepth());
 Linestyle(10,clblack);
 beginfill(couleur);
 roundrect(-taille/2.5,-taille/2.5,2*taille/2.5,2*taille/2.5,30);
 blendmode:='multiply';
end;
 
procedure diapo.Roundrect(x,y,w,h,radius:number);
var
 ra,b:number;
begin
  ra := x + w;
  b := y + h;
  moveTo(x+radius, y);
  lineTo(ra-radius, y);
  CurveTo(ra,y, ra, y+radius);
  lineTo(ra, y+h-radius);
  CurveTo(ra, b, ra-radius, b);
  lineTo(x+radius, b);
  CurveTo(x, b,x, b-radius);
  lineTo(x, y+radius);
  CurveTo(x, y, x+radius,y);
end;
 
 
begin
  scene.create;
end.
__________________
Citation:
tout développeur plongé dans son code subit une poussée d'urticaire de bas en haut égale au poids du volume d'unités qu'il ajoute.
Archimède est actuellement connecté   Envoyer un message privé Réponse avec citation 20
Vieux 05/11/2012, 08h15   #3
Roland Chastain
Membre Expert
 
Homme Roland Chastain
Inscription : décembre 2011
Messages : 683
Détails du profil
Informations personnelles :
Nom : Homme Roland Chastain
Âge : 39
Localisation : Mali

Informations professionnelles :
Secteur : Enseignement

Informations forums :
Inscription : décembre 2011
Messages : 683
Points : 1 001
Points : 1 001
Joli !
__________________
L'Art est long et le Temps est court.
Roland Chastain est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 05/11/2012, 09h53   #4
Archimède
Membre émérite
 
Avatar de Archimède
 
Homme anthony
Enseignant
Inscription : avril 2005
Messages : 1 021
Détails du profil
Informations personnelles :
Nom : Homme anthony
Localisation : France, Charente Maritime (Poitou Charente)

Informations professionnelles :
Activité : Enseignant
Secteur : Enseignement

Informations forums :
Inscription : avril 2005
Messages : 1 021
Points : 973
Points : 973
merci
__________________
Citation:
tout développeur plongé dans son code subit une poussée d'urticaire de bas en haut égale au poids du volume d'unités qu'il ajoute.
Archimède est actuellement connecté   Envoyer un message privé Réponse avec citation 00
Réponse Cette discussion est résolue.
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 21h41.


 
 
 
 
Partenaires

Hébergement Web