elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP) (Moderador: kub0x)
| | | |-+  alguien que pueda traducir de pascal a vbnet
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: alguien que pueda traducir de pascal a vbnet  (Leído 1,505 veces)
spiritdead

Desconectado Desconectado

Mensajes: 296


Ver Perfil
alguien que pueda traducir de pascal a vbnet
« en: 15 Septiembre 2012, 18:46 pm »

buenas tardes estoy buscando alguien que pueda traducir este fragmento de algoritmo de pascal a vbnet

si alguno puede
Código:
interface
  uses Windows, Dialogs, Graphics, SysUtils, CommonTypes, Classes;

 type TSpectrum = Class(TObject)
    private
      VisBuff : TBitmap;
      BackBmp : TBitmap;

      BkgColor : TColor;
      SpecHeight : Integer;
      PenColor : TColor;
      PeakColor: TColor;
      DrawType : Integer;
      DrawRes  : Integer;
      FrmClear : Boolean;
      UseBkg   : Boolean;
      PeakFall : Integer;
      LineFall : Integer;
      ColWidth : Integer;
      ShowPeak : Boolean;

       FFTPeacks  : array [0..128] of Integer;
       FFTFallOff : array [0..128] of Integer;

    public
     Constructor Create (Width, Height : Integer);
     procedure Draw(HWND : THandle; FFTData : TFFTData; X, Y : Integer);
     procedure SetBackGround (Active : Boolean; BkgCanvas : TGraphic);

     property BackColor : TColor read BkgColor write BkgColor;
     property Height : Integer read SpecHeight write SpecHeight;
     property Width  : Integer read ColWidth write ColWidth;
     property Pen  : TColor read PenColor write PenColor;
     property Peak : TColor read PeakColor write PeakColor;
     property Mode : Integer read DrawType write DrawType;
     property Res  : Integer read DrawRes write DrawRes;
     property FrameClear : Boolean read FrmClear write FrmClear;
     property PeakFallOff: Integer read PeakFall write PeakFall;
     property LineFallOff: Integer read LineFall write LineFall;
     property DrawPeak   : Boolean read ShowPeak write ShowPeak;
  end;

 var Spectrum : TSpectrum;

implementation

     Constructor TSpectrum.Create(Width, Height : Integer);
      begin
        VisBuff := TBitmap.Create;
        BackBmp := TBitmap.Create;

          VisBuff.Width := Width;
          VisBuff.Height := Height;
          BackBmp.Width := Width;
          BackBmp.Height := Height;

          BkgColor := clBlack;
          SpecHeight := 100;
          PenColor := clWhite;
          PeakColor := clYellow;
          DrawType := 0;
          DrawRes  := 1;
          FrmClear := True;
          UseBkg := False;
          PeakFall := 1;
          LineFall := 3;
          ColWidth := 5;
          ShowPeak := True;
      end;

     procedure TSpectrum.SetBackGround (Active : Boolean; BkgCanvas : TGraphic);
      begin
        UseBkg := Active;
        BackBmp.Canvas.Draw(0, 0, BkgCanvas);
      end;

     procedure TSpectrum.Draw(HWND : THandle; FFTData : TFFTData; X, Y : Integer);
        var i, YPos : LongInt; YVal : Single;
       begin

       if FrmClear then begin
          VisBuff.Canvas.Pen.Color := BkgColor;
          VisBuff.Canvas.Brush.Color := BkgColor;
          VisBuff.Canvas.Rectangle(0, 0, VisBuff.Width, VisBuff.Height);
           if UseBkg then VisBuff.Canvas.CopyRect(Rect(0, 0, BackBmp.Width, BackBmp.Height), BackBmp.Canvas, Rect(0, 0, BackBmp.Width, BackBmp.Height));
       end;
        DrawRes := 1;
        VisBuff.Canvas.Pen.Color := PenColor;
         for i := 0 to 128 do begin
           YVal := Abs(FFTData[(i * DrawRes)]);
           YPos := Trunc((YVal) * 256);
           if YPos > Height div 2 then YPos := SpecHeight div 2;

           if YPos >= FFTPeacks[i] then FFTPeacks[i] := YPos
              else FFTPeacks[i] := FFTPeacks[i] - PeakFall;

           if YPos >= FFTFallOff[i] then FFTFallOff[i] := YPos
              else FFTFallOff[i] := FFTFallOff[i] - LineFall;

              if (VisBuff.Height - FFTPeacks[i]) > VisBuff.Height then FFTPeacks[i] := 0;
              if (VisBuff.Height - FFTFallOff[i]) > VisBuff.Height then FFTFallOff[i] := 0;

              case DrawType of
                0 : begin
                       VisBuff.Canvas.MoveTo(X + i, Y + VisBuff.Height);
                       VisBuff.Canvas.LineTo(X + i, Y + VisBuff.Height - FFTFallOff[i]);
                       if ShowPeak then VisBuff.Canvas.Pixels[X + i, Y + VisBuff.Height - FFTPeacks[i]] := Pen;
                    end;

                1 : begin
                     if ShowPeak then VisBuff.Canvas.Pen.Color := PeakColor;
                     if ShowPeak then VisBuff.Canvas.MoveTo(X + i * (ColWidth + 1), Y + VisBuff.Height - FFTPeacks[i]);
                     if ShowPeak then VisBuff.Canvas.LineTo(X + i * (ColWidth + 1) + ColWidth, Y + VisBuff.Height - FFTPeacks[i]);

                     VisBuff.Canvas.Pen.Color := PenColor;
                     VisBuff.Canvas.Brush.Color := PenColor;
                     VisBuff.Canvas.Rectangle(X + i * (ColWidth + 1), Y + VisBuff.Height - FFTFallOff[i], X + i * (ColWidth + 1) + ColWidth, Y + VisBuff.Height);
                    end;
              end;
         end;

          BitBlt(HWND, 0, 0, VisBuff.Width, VisBuff.Height, VisBuff.Canvas.Handle, 0, 0, srccopy)
       end;
end.


En línea

Facilitador De Tareas - Task Simplifier (FDT)
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Alguien sabe traducir videojuegos de la playstation?
Juegos y Consolas
Medori 0 1,308 Último mensaje 25 Marzo 2006, 17:12 pm
por Medori
Ayuda !!!! Alguien que me pueda ayudar TT
Multimedia
Gotten 1 1,747 Último mensaje 16 Agosto 2006, 21:24 pm
por .hack//
Alguien q me pueda ayudar?
Ingeniería Inversa
alegriahoy 3 3,622 Último mensaje 21 Febrero 2009, 20:12 pm
por Revolutions
Ayuda para traducir una función anónima de C# a VBNET
.NET (C#, VB.NET, ASP)
Eleкtro 1 2,398 Último mensaje 4 Junio 2013, 20:13 pm
por Eleкtro
¿Alguien sabe Francés o Italiano? Traducir 3/4 palabras.
Foro Libre
DeMoNcRaZy 7 2,002 Último mensaje 8 Septiembre 2015, 19:30 pm
por kondrag_X1
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines