I have made a small EXE with a transparent form which has a TImage on it . For making my form transparent , i use this code :
Function TForm1.CombineRegions (FrmX , FrmY :Integer;CtrlComp : TControl;Var RegHandle : THandle) : Boolean;
Var
CtrlHandle : THandle;
CtrlLeft,
CtrlTop,
CtrlWidth,
CtrlHt : Integer;
begin
Result := False;
CtrlHandle := 0;
FrmX := 0;
FrmY := 0;
Try
CtrlLeft := CtrlComp.Left;
CtrlTop := CtrlComp.Top;
CtrlWidth := CtrlComp.Width;
CtrlHt := CtrlComp.Height;
Except
Exit;
End;
Try
FrmX:=0;
FrmY:=0;
FrmX := FrmX + CtrlLeft;
FrmY := FrmY + CtrlTop;
CtrlHandle := CreateRectRgn(FrmX, FrmY, FrmX + CtrlWidth, FrmY + CtrlHt) ;
CombineRgn(RegHandle, RegHandle, CtrlHandle, RGN_OR) ;
Except
End;
End;
What it does is first make all the form disappear , then as per which controls i want on form , i will call the above function and only that region will be drawn . Now my TImage has an image which has some background color to it.
As you can see , the image has some background to it . I want my TImage to be drawn so that only the bitmap inside is drawn , not the whole region. Can it be done ? Thanks in Advance.
TImage
or would be enough for you when the picture would be loaded just from file and displayed on a transparent form ? – TLama