AIDER à convertir ce code en Delphi to vb.net

cs_allinfo Messages postés 5 Date d'inscription mercredi 27 avril 2005 Statut Membre Dernière intervention 18 octobre 2008 - 13 oct. 2008 à 10:44
cs_allinfo Messages postés 5 Date d'inscription mercredi 27 avril 2005 Statut Membre Dernière intervention 18 octobre 2008 - 18 oct. 2008 à 08:52
Bonjour
quelqu'un peut m'AIDER à convertir ce code en Delphi to vb.net
Merci

TGFX = record
gfx_data_size: longword;
gfx_height: word;
gfx_width: word;
gfx_idIndex:longword;
gfx_data: array ofbyte;
gfx_uncompressed_data: array ofbyte;
gfx_uncompressed_size:longword;
gfx_offset:Byte;
end;
 
type TTGFX = array of TGFX;
 
type TShapePLT = array[0..255]of TShape;
 
type TPLT = array[0..255]of longword;
 
type TTPLT = array of TPLT;
 
type STY = record
sty_champ_1: word;
sty_data:array ofbyte;
end;
 
 
var ShapePLT:TShapePLT;
TabPLT:TTPLT;
TabGFX:TTGFX;
ActualGFXIndex:longword;
GFXCount:longword;

procedure TformScriptGUIEditor.mnuLoadFirmwareClick(Sender: TObject);
var
s:string;
p,x:longword;
f,InputStream, OutputStream: TFileStream;
DeCompressionStream: TZDecompressionStream;
InputFileName, OutputFileName: string;

begin
if dlgOpenFirmware.Execute then
begin
f:=TFileStream.Create(dlgOpenFirmware.FileName,fmOpenRead);
SetLength(s,f.size);
f.Read(s[1],f.size);
f.Free;
p:=pos(chr($0E)+chr($F1)+chr($01)+chr($00),s);
if p=0 then
begin
MessageDlg('No ScriptGUI in this file!',mtError,[mbYes],0);
SetLength(s,0);
end
else
s:=copy(s,p,length(s));
x:=ord(s[7])*256+ord(s[8]);
AnalyseGUIScript(s);
SetLength(s,0);
end;

end;
end;

procedure TformScriptGUIEditor.AnalyseGUIScript(s:string);
var p,i,x:longword;
t:string;

begin
gfxcount:=0;
SetLength(TabPLT,1);
p:=pos(chr(01)+'TLP',s);
if p<>0 then
begin
for i:=0 to 255 do
begin
x:=GetLongWord(s,p+12) and $00FFFFFF;
ShapePLT[i].Brush.Color:=x;
ShapePLT[i].Hint:=inttohex(x,8);
TabPLT[0][i]:=x;
p:=p+4;
end;
end
else
MessageDlg('No palette!',mtError,[mbYes],0);
ListGraphics.Clear;
p:=pos(chr(01)+'XFG',s);
if p<>0 then
begin
while (p<length(s)) do
begin
if pos(chr(01)+'XFG',copy(s,p,4))<>0 then
begin
inc(gfxcount);
SetLength(TabGFX,gfxcount);
with TabGFX[gfxcount-1] do
begin
gfx_idIndex:=GetLongWord(s,p+8);
gfx_uncompressed_size:=GetLongWord(s,p+12);
gfx_data_size:=GetLongWord(s,p+16);
gfx_height:=GetWord(s,p+20);
gfx_width:=GetWord(s,p+22);
SetLength(gfx_data,gfx_data_size*2);
for x:=0 to gfx_data_size - 1 do gfx_data[x]:=ord(s[p+24+x]);

setlength(gfx_uncompressed_data,gfx_uncompressed_size);
if gfx_uncompressed_size<>bmp_rle_decode(gfxcount-1) then
ShowMessage('Erreur de décompression');
gfx_offset:=(gfx_uncompressed_size - gfx_height*gfx_width) div gfx_height;
t:=inttostr(gfxcount); while (length(t)<3) do t:='0'+t;
t:=t+' - ID : : '+inttohex(gfx_idIndex,8);
ListGraphics.Items.Add(t);
p:=p+GetLongWord(s,p+4);
end;
end
else p:=p+4;
end;
end
else
MessageDlg('No graphics!',mtError,[mbYes],0);

end;

7 réponses

lillith212 Messages postés 1229 Date d'inscription vendredi 16 novembre 2007 Statut Membre Dernière intervention 16 juin 2009
13 oct. 2008 à 10:46
Bonjour,
Quel est ton niveau en .net?
quelles sont les parties que tu as déjà converti?
Optionnel : Pourquoi convertir en .net?

Merci
PS : Tu n'avais pas besoin de reposter... mais c'est pas grave... Si un admin peut supprimer le topic précédent? Merci

S.L.B.
<hr />-- Le règlement tu liras -- Des recherches tu feras -- Le style SMS tu banniras --
-- De la validation pertinente tu feras -- Du respect tu auras -- <
0
cs_allinfo Messages postés 5 Date d'inscription mercredi 27 avril 2005 Statut Membre Dernière intervention 18 octobre 2008
13 oct. 2008 à 11:04
je veux convertir tous le code si tu peux

mon niveau en vb : bien

pkoi tous ces question??
0
lillith212 Messages postés 1229 Date d'inscription vendredi 16 novembre 2007 Statut Membre Dernière intervention 16 juin 2009
13 oct. 2008 à 11:09
Re:
Parce que j'aime comprendre ce que je fais....
Ensuite, je ne vais pas convertir ton code mais t'aider à  le faire compte tenu que tu as un niveau bien en vb.
Ensuite, je ne comprends pas l'intérêt de convertir ton code si celui-ci fonctionne. Sauf si c'est pour apprendre et dans ce cas, le forum va attendre que tu postes ta traduction et pourquoi pas les messages d'erreurs que tu obtiens ainsi nous pourrions t'aider.
Pas de tout cuit...
Désolée

S.L.B.
<hr />-- Le règlement tu liras -- Des recherches tu feras -- Le style SMS tu banniras --
-- De la validation pertinente tu feras -- Du respect tu auras -- <
0
cs_allinfo Messages postés 5 Date d'inscription mercredi 27 avril 2005 Statut Membre Dernière intervention 18 octobre 2008
13 oct. 2008 à 11:33
merci pour l'aide en tous cas

ns somme la pour l'aide pas autre chose
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
lillith212 Messages postés 1229 Date d'inscription vendredi 16 novembre 2007 Statut Membre Dernière intervention 16 juin 2009
14 oct. 2008 à 12:15
Re:
Une précision, tu trouveras sur le site des outils qui aide à la conversion de code.
Bon courage

S.L.B.
<hr />-- Le règlement tu liras -- Des recherches tu feras -- Le style SMS tu banniras --
-- De la validation pertinente tu feras -- Du respect tu auras -- <
0
cs_allinfo Messages postés 5 Date d'inscription mercredi 27 avril 2005 Statut Membre Dernière intervention 18 octobre 2008
14 oct. 2008 à 18:35
tu peux me donner stp

et merci
0
cs_allinfo Messages postés 5 Date d'inscription mercredi 27 avril 2005 Statut Membre Dernière intervention 18 octobre 2008
18 oct. 2008 à 08:52
help please
0
Rejoignez-nous