Link to home
Start Free TrialLog in
Avatar of aharasts
aharastsFlag for United States of America

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.Assign(bmp);
  bmp.Free;
end;

procedure TForm1.DBImage1MouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
    if ssLeft in Shift then
    begin
    DBImage1.Picture.Bitmap.Canvas.MoveTo(xp,yp);
    DBImage1.Picture.Bitmap.Canvas.LineTo(X,Y);
    xp := X;
    yp := y;
    end;
end;

procedure TForm1.DBImage1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  xp := X;
  yp := y;
end;
ASKER CERTIFIED SOLUTION
Avatar of TheRealLoki
TheRealLoki
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial