Se me presento un problema
, es ke deseo visualizar la imagen y no lo hace, si lo recibe el server al cual se lo envio, pero no me lo muestra.
Pongo como esta el codigo; lo puse igual a como me dijiste(nada mas estoy realizando el envio de la imagen para ver si funciona, cuando rule lo meto como un modulo en mi programa ):
//Cliente lo manda
#include <vcl.h>
#pragma hdrstop
#include "clifun.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
//ClientSocket1->Socket->SendText(Edit1->Text);
if(ClientSocket1->Active) {
TMemoryStream *stream = new TMemoryStream();
Image1->Picture->Bitmap->SaveToStream(stream);
ClientSocket1->Socket->SendBuf(stream, sizeof(stream));
stream->Free();
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Edit1->Text="";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
ClientSocket1->Port = 23;
ClientSocket1->Host = "192.168.52.59";
ClientSocket1->Active = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
ClientSocket1->Active = false;
}
//---------------------------------------------------------------------------
//el ke recibe
--------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "serfun.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{
ServerSocket1->Active = false;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
ServerSocket1->Port = 23;
ServerSocket1->Active = true;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ServerSocket1ClientRead(TObject *Sender,
TCustomWinSocket *Socket)
{
// Edit1->Text=Socket->ReceiveText();
TMemoryStream *stream = new TMemoryStream();
ServerSocket1->Socket->Connections[0]->ReceiveBuf(stream, sizeof(stream));
stream->Position = 0;
Image2->Picture->Bitmap->LoadFromStream(stream);
stream->Free();
Image2->Show();
ShowMessage("Recibido");
}
//---------------------------------------------------------------------------