aharasts
asked on
dbimage drawing
I thought if I could use an Image component to draw in, I would be able to do the same with a DBImage to save the drawing in a graphic field in a paradox table.
I have not been able to figure out how to save and retrieve the drawings.
I can I use a DBImage to not ony draw in, but save it and retrieve it from a table?
I am using the code below to draw in the DBimage:
procedure TForm1.FormCreate(Sender: TObject);
var bmp: TBitmap;
begin
bmp := TBitmap.Create;
bmp.Width := DBImage1.Width;
bmp.Height := DBImage1.Height;
bmp.PixelFormat := pf24bit;
DBImage1.Picture.Bitmap.As sign(bmp);
bmp.Free;
end;
procedure TForm1.DBImage1MouseMove(S ender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if ssLeft in Shift then
begin
DBImage1.Picture.Bitmap.Ca nvas.MoveT o(xp,yp);
DBImage1.Picture.Bitmap.Ca nvas.LineT o(X,Y);
xp := X;
yp := y;
end;
end;
procedure TForm1.DBImage1MouseDown(S ender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
xp := X;
yp := y;
end;
I have not been able to figure out how to save and retrieve the drawings.
I can I use a DBImage to not ony draw in, but save it and retrieve it from a table?
I am using the code below to draw in the DBimage:
procedure TForm1.FormCreate(Sender: TObject);
var bmp: TBitmap;
begin
bmp := TBitmap.Create;
bmp.Width := DBImage1.Width;
bmp.Height := DBImage1.Height;
bmp.PixelFormat := pf24bit;
DBImage1.Picture.Bitmap.As
bmp.Free;
end;
procedure TForm1.DBImage1MouseMove(S
Y: Integer);
begin
if ssLeft in Shift then
begin
DBImage1.Picture.Bitmap.Ca
DBImage1.Picture.Bitmap.Ca
xp := X;
yp := y;
end;
end;
procedure TForm1.DBImage1MouseDown(S
Shift: TShiftState; X, Y: Integer);
begin
xp := X;
yp := y;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.