DelphiXE(OCX)
○イメージをデータ形式で設定する例
type
TByteArray = Array of byte;
var
imageLength: Longint;
F: TFileStream;
baImageData: TByteArray;
ImageFile: array[0..255]
of Char;
begin
F:=TFileStream.Create(String(ImageFile),fmOpenRead);
imageLength := F.Size;
SetLength(baImageData, imageLength);
F.ReadBuffer(Pointer(baImageData)^,imageLength);
F.Free;
// Variant型に変換します。
DynArrayToVariant(vImageData,@baImageData[0],
TypeInfo(TByteArray));
// さらにOleVariant型に変換します。
oImageData := vImageData;
//イメージデータを描画します。
Jvrlib.SetFieldImageData('IMAGE_2', imageLength,oImageData);