📄 clientdm.cpp
字号:
//---------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "clientdm.h"
#include "clientc.h"
//---------------------------------------------------------------------
#pragma resource "*.dfm"
TCustomerData *CustomerData;
//---------------------------------------------------------------------
__fastcall TCustomerData::TCustomerData(TComponent* AOwner)
: TDataModule(AOwner)
{
}
//---------------------------------------------------------------------
void __fastcall TCustomerData::client_dsetAfterOpen(TDataSet *DataSet)
{
/* Graphics::TBitmap *bmpfd=new Graphics::TBitmap();
AnsiString as;
TVariant * varia;
TStringStream* pss = new TStringStream(as);
// Form1->DBImage1->Picture->SaveToFile("c:\\pic.jpg");
TBlobStream *IMAGE;
IMAGE=new TBlobStream((TBlobField*)DataSet->FieldByName("image"),bmRead);
bmpfd->LoadFromStream(IMAGE);
Form1->Image1->Picture->Bitmap->Assign(bmpfd);
delete IMAGE;
delete bmpfd;
TMemoryStream* pms = new TMemoryStream();
// DataSet->First();
TField * temp;
temp=DataSet->FieldByName("image");
ShowMessage("ok");
if (temp->IsBlob()) // GetData does not work for BLOB fields
{
ShowMessage("ok");
void *MyBuffer = malloc(temp->DataSize);
temp->GetData(MyBuffer,true);
pms->Write(MyBuffer,temp->DataSize);
ShowMessage(AnsiString(temp->DataSize));
pms->SaveToFile("c:\\pms.bmp");
free(MyBuffer);
} */
}
//---------------------------------------------------------------------------
void __fastcall TCustomerData::client_dset_imageAfterOpen(
TDataSet *DataSet)
{
/* TMemoryStream* pms = new TMemoryStream();
// TField * temp;
// temp= FindField("image");
// temp=DataSet->FieldByName("image");
// if (temp->IsBlob()) // GetData does not work for BLOB fields
//{
ShowMessage("ok");
// DataSet->Fields->Fields(0)->Value;
void *MyBuffer = malloc(temp->DataSize);
temp->GetData(MyBuffer,true);
pms->Write(MyBuffer,temp->DataSize);
ShowMessage(AnsiString(temp->DataSize));
pms->SaveToFile("c:\\pms.bmp");
free(MyBuffer); */
// }
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -