Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Gráficos
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 18-01-2008
Avatar de jachguate
jachguate jachguate is offline
Miembro
 
Registrado: may 2003
Ubicación: Guatemala
Posts: 6.254
Poder: 28
jachguate Va por buen camino
También se puede hacer con un stream:

Código Delphi [-]
type
  TColorRGB = packed record
                B, G, R: byte;
  end;

  TCuboRGB = array[0..255,0..255,0..255] of TColorRGB;

procedure GuardaCubo(const CuboRGB: TCuboRGB);
var
  Arch: TFileStream;
begin
  Arch := TFileStream.Create('c:\datos.dat', fmCreate or fmShareExclusive);
  try
    if Arch.Write(CuboRGB, SizeOf(CuboRGB)) <> SizeOf(CuboRGB) then
      raise Exception.Create('Error al escribir!');
  finally
    Arch.Free;
  end;
end;

procedure LeeCubo(var CuboRGB: TCuboRGB);
var
  Arch: TFileStream;
begin
  Arch := TFileStream.Create('c:\datos.dat', fmOpenRead or fmShareDenyNone);
  try
    if Arch.Read(CuboRGB, SizeOf(CuboRGB)) <> SizeOf(CuboRGB) then
      raise Exception.Create('Error al leer!');
  finally
    Arch.Free;
  end;
end;

Hasta luego.

__________________
Juan Antonio Castillo Hernández (jachguate)
Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate
Responder Con Cita
  #2  
Antiguo 18-01-2008
Avatar de Crandel
[Crandel] Crandel is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Parana, Argentina
Posts: 1.475
Poder: 23
Crandel Va por buen camino
Cita:
Empezado por jachguate Ver Mensaje
También se puede hacer con un stream:
sisi, me quedaría con tu solución
__________________
[Crandel]
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
problema con type anubis Varios 1 06-05-2007 21:24:37
type needs finalization henrygale Varios 2 13-02-2007 16:49:44
Como almaceno un Type Record en binario en un blob de MySQL molarte SQL 2 03-10-2005 20:37:16
¿Como Guardar un "RECORD" en un campo BLOB? sitrico Conexión con bases de datos 5 29-06-2004 17:32:01
Type Memo emeritos Conexión con bases de datos 1 07-11-2003 14:40:06


La franja horaria es GMT +2. Ahora son las 22:13:30.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi