Do this mean u still have problems?.. if so.. i modified the code u pasted to make it work on my side (delphi 5), to do what u ask in your first post
here it goes:
// bmp_file_source_path='C:\source.bmp';
// bmp_file_dest_path='C:\dest.bmp';
//...
procedure TForm1.Button1Click(Sender: TObject);
var
BMsrc,BMdst: TBitmap;
Pic: TBitmap;
Source,Dest: TRect;
begin
// "/2" can cause u a problem, u should use "div 2"
Dest := Rect(0, 0, 16, picBkg.Height div 2);
Source := Rect(0, picBkg.Height div 2, 16, picBkg.Height);
Pic := TBitmap.Create;
//Pic.Assign(picBkg); //<----why? this is use to
//copy the hole bitmap .. and as i read, u need only the
//half bothom
//u must set a size to your bitmap named pic
//since u dont assign anythign to it (assign set
//the size automaticly)
Pic.Height:= picBkg.Height div 2;
pic.Width:= 16;
Pic.Canvas.CopyRect(Dest, picBkg.Canvas, Source);
//...
Pic.SaveToFile(bmp_file_dest_path); //to see the result
//...
Pic.Free;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
picBkg:=TBitmap.Create;
picBkg.LoadFromFile(bmp_file_source_path);
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
picBkg.free;
end;
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.