Home > Back-end >  How to get the Timage Picture. The Data in the Data
How to get the Timage Picture. The Data in the Data

Time:09-15

Want to use a button, click later, access to the image. The picture. The data of these code 0 a544... These, in the form of a string,

Should ask how can I get?


CodePudding user response:

Interface design available or when the program runs to get it?

CodePudding user response:

You can have a look at the help of ComponentToString example, persistence is the component that converts text description, CB, actually the Delphi IDE is using persistence technology keep visual form can be converted into text,

CodePudding user response:

 
The function GhaphicToHex (AGraphic: TGraphic) : string;
Var
Stream, ms: TMemoryStream;
BLen: Byte;
ISize: LongInt;
SName: string;
The begin
The sName: AGraphic.=ClassName.
BLen:=length (sName);
Stream:=TMemoryStream. Create;
Stream. WriteBuffer (bLen, 1);
Stream. WriteBuffer (sName [1], the bLen);
Ms:=TMemoryStream. Create;
AGraphic. SaveToStream (ms);
Ms. Position:=0;
ISize:=Ms. Size;
Stream. WriteBuffer (iSize, sizeof (iSize));
Stream. CopyFrom (ms, iSize);
Ms. The Free;
SetLength (Result, stream. Size * 2);
BinToHex (stream. The Memory, PChar (Result), the stream. Size);
Stream. Free;
The end;

procedure TForm1.Button1Click(Sender: TObject);
The begin
Memo1. Text:=GhaphicToHex (image1. Picture. Graphic);
The end;

CodePudding user response:

Why need this strange things?
  • Related