lorrant
Messages postés11Date d'inscriptionmercredi 6 août 2003StatutMembreDernière intervention 2 octobre 2007
-
6 août 2003 à 23:08
lorrant
Messages postés11Date d'inscriptionmercredi 6 août 2003StatutMembreDernière intervention 2 octobre 2007
-
9 août 2003 à 10:04
Bonjour,
Je suis débutant en programmation, et j'ai réalisé un petit programme pour la boîte où je bosse (qui n'a rien à voir dans la programmation...)
Je dois imprimer des résultats, avec l'incrustation du logo de la boite. Les résultats sont sous forme de rectangle de couleur avec un style (diag, solid, cross...). Pour imprimer un plus le logo, j'utilise printer.canvas.draw... Tout fonctionne sous windows XP, mais pas sous windows 95 ou 98... Tout s'imprime, mais si le style des rectangles n'est pas bssolid, une couleur de fond leur est attibuée en plus su style... Y a-t-il un moyen d'éviter ce PB...
Merci pour la réponse que vous me donnerez...
lorrant
Messages postés11Date d'inscriptionmercredi 6 août 2003StatutMembreDernière intervention 2 octobre 2007 9 août 2003 à 10:04
Voici un extrait complet pour un des cas utilisé dans le prog... tous ont le même PB...
with printer do
begin
begindoc;
with canvas do
begin
l:=3500;
y0:=500;
x0:=round(l/2);
if form8.radiobutton5.checked=true then uy:=round(1500/50) else uy:=round(1500/35);
textout(x0-250,y0-80,'hauteur en cm');
TextOut(x0-150,y0-20,'0.0');
textout((x0*2)-70,y0-20,'hauteur en cm');
TextOut((x0*2)-45,y0-5,'0.0');
yd:=0;
k:=1;
//-----dessin des couches-----\\
for j:=1 to ai do
begin
s:=A[2,j];
y:=round(An[1,j]*uy);
yy:=round(An[1,j-1]*uy);
e:=round(An[2,j]*uy/2)+20;
pen.width:=2;
brush.color:=clwhite;
textout(x0-150,y0+y+yd-20,format('%1.1f',[An[1,j]]));
textout(x0+100,y0+y+yd-e,format('%1.1f',[An[2,j]]));
brush.color:=stringtocolor(s);
if An[3,j]=1 then brush.style:=bssolid;
if An[3,j]=2 then brush.style:=bsbdiagonal;
if An[3,j]=3 then brush.style:=bsfdiagonal;
if An[3,j]=4 then brush.style:=bshorizontal;
if An[3,j]=5 then brush.style:=bsvertical;
if An[3,j]=6 then brush.style:=bscross;
if An[3,j]=7 then brush.style:=bsdiagcross;
rectangle(x0-80,y0+yy+yd,x0+80,y0+y+yd);
if (An[4,j]=1) or (An[4,j]=2) then yd:=yd+30;
ll:=round(textwidth('cassée')/2);
if An[4,j]=1 then textout(x0-ll,y0+y+yd-35,'cassée');
ll:=round(textwidth('décollée')/2);
if An[4,j]=2 then textout(x0-ll,y0+y+yd-35,'décollée');
pen.width:=1;
end;
//-----dessin des zones désag.-----\\
if adi<>0 then
begin
for j:=1 to adi do
begin
yd:=0;
y:=round(Adn[1,j]*uy);
e:=round((Adn[2,j]-Adn[1,j]));
for jjj:=1 to ai do
begin
if (Adn[1,j]>=An[1,jjj]) and (An[4,jjj]<>0) then yd:=yd+30;
end;
for jj:=0 to e+1 do
begin
brush.style:=bsclear;
textout(x0-78,y0+y-8+yd+(jj*26),'* * * * * * *');
textout(x0-210,y0+y+yd+round((e)*uy/2)-20,'z. désag.');
end;
end;
end;
//-----dessin de la fracture-----\\
pen.width:=5;
dx:=8;
dh:=round(Af[2]-Af[1]);
if Af[2]<>0 then
begin
for j:=0 to 9 do
begin
yh:=round(Af[1]);
moveto(x0+dx,y0+(yh+round((dh/10)*j))*uy);
lineto(x0-dx,y0+(yh+round((dh/10)*(j+1)))*uy);
dx:=-dx;
end;
end;
pen.width:=1;
//-----afficher label-----\\
yd:=0;
for j:=1 to ai do
begin
y:=round(An[1,j]*uy);
e:=round(An[2,j]*uy/2)+5;
brush.style:=bssolid;
brush.color:=clwhite;
if An[5,j]=18 then
begin
ll:=round(textwidth(A[3,j])/2);
textout(x0-ll,y0+y+yd-e,A[3,j]);
end
else
begin
ll:=round(textwidth(TD[round(An[5,j])])/2);
textout(x0-ll,y0+y+yd-e,TD[round(An[5,j])]);
end;
if (An[4,j]=1) or (An[4,j]=2) then yd:=yd+30;
end;
font.size:=10;
ll:=round(textwidth(format('%s / %s',[At[1],At[2]]))/2);
textout(x0-ll,y0+yd+y+50,format('%s / %s',[At[1],At[2]]));
font.size:=8;
ll:=round(textwidth(At[4])/2);
textout(x0-ll,y0+yd+y+100,At[4]);
ll:=round(textwidth(At[5])/2);
textout(x0-ll,y0+yd+y+150,At[5]);
ll:=round(textwidth(At[6])/2);
textout(x0-ll,y0+yd+y+200,At[6]);
ljpg:=Tbitmap.create;
ljpg.loadfromfile(form4.edit6.text);
Image3.Picture.loadfromfile(ljpg)
x0:=round((image3.picture.Width)/2);
y0:=round((image3.picture.height)/2);
draw(800-x0,205-y0,ljpg);
end;
enddoc;
end;
Il semblerait que ce soit la fonction Draw qui soit à l'origine du PB...