Ver Mensaje Individual
  #2  
Antiguo 31-07-2014
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 21
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
Neeruu,

Cita:
Empezado por Neeruu
...Encontré este ejemplo de como pasar de SVG a PNG...El ejemplo esta en Javascript...


Revisa este código:
Código Delphi [-]
  procedure ExecNewProcess(ProgramName : String; Wait: Boolean);
  var
    StartInfo : TStartupInfo;
    ProcInfo : TProcessInformation;
    CreateOK : Boolean;
  begin
    FillChar(StartInfo, SizeOf(TStartupInfo), #0);
    FillChar(ProcInfo, SizeOf(TProcessInformation), #0);
    StartInfo.cb := SizeOf(TStartupInfo);
    CreateOK := CreateProcess(nil, PChar(ProgramName), nil, nil, False,
                CREATE_NEW_PROCESS_GROUP + NORMAL_PRIORITY_CLASS,
                nil, nil, StartInfo, ProcInfo);
    if CreateOK then begin
      //may or may not be needed. Usually wait for child processes
      if Wait then
        WaitForSingleObject(ProcInfo.hProcess, INFINITE);
    end else
      ShowMessage('Unable to run ' + ProgramName);
  
    CloseHandle(ProcInfo.hProcess);
    CloseHandle(ProcInfo.hThread);
  end;
  
  procedure ConvertSVGtoPNG(aFilename: String);
  const
    ExecLine = 'c:\windows\system32\java.exe -jar C:\Apps\batik-1.7\batik-rasterizer.jar ';
  begin
    ExecNewProcess(ExecLine + aFilename, True);
  end;
El código anterior tomado de Converting SVG to PNG using C#, utiliza el Batik SVG Toolkit para convertir una imagen en SVG a PNG.

Nota: El código del ejemplo y el Batik SVG Toolkit, no fueron probados para efectos de este mensaje, quizás te interese probarlo

Espero sea útil

Nelson.
Responder Con Cita