Win32API【2】
■ このスレッドは過去ログ倉庫に格納されています
0737727
NGNG>>730 のコードをDelphiで実行したのですが何もおこりませんでしたし
結局APIを使う方法が判らず、ビットマップを自分で作成してしまう事にしました
function CreateGradationRectBitmap(const width,height:Integer;const LeftColor,RightColor:TColor):TBitmap;
var L,R:array [0..2] of integer;
procedure decompose(var w:array of integer;const col:TColor);
begin
w[0]:= col and $FF;
w[1]:=(col shr 8) and $FF;
w[2]:=(col shr 8) and $FF;
end;
var i,j,w:integer;
var p:pByte;
begin
decompose(L,LeftColor);
decompose(R,RightColor);
Result:=TBitmap.Create;
Result.Monochrome :=False;
Result.PixelFormat:=pf24bit;
Result.Width :=width;
Result.Height:=height;
p:= pByte(Result.ScanLine[0]);
w:=width-1;
for i:=0 to w do begin
{色の按分 } for j:=0 to High(L) do begin p^:= (R[j]*i +L[j]*(w-i))div w; inc(p);end;
end;
w:=width*3;
With Result do for i:=1 to Height-1 do Move(ScanLine[0]^ , ScanLine[i]^ ,w);
end;
■ このスレッドは過去ログ倉庫に格納されています