Recent

Author Topic: Vampyre imaging load image [CLOSE]  (Read 257 times)

Pe3s

  • Hero Member
  • *****
  • Posts: 573
Vampyre imaging load image [CLOSE]
« on: November 13, 2024, 10:58:42 am »
Hello, I wanted to try the vampyre library but I don't know how to display the image, I get an Access violation error.
Could you please tell me what I'm doing wrong?

Code: Pascal  [Select][+][-]
  1. procedure TForm1.FormCreate(Sender: TObject);
  2. begin
  3.   FImage := TMultiImage.Create;
  4. end;
  5.  
  6. procedure TForm1.Button1Click(Sender: TObject);
  7. begin
  8.   if OpenDialog1.Execute then
  9.   begin
  10.     FImage.LoadFromFile(OpenDialog1.FileName);
  11.     PaintBox1.Invalidate;
  12.   end;
  13. end;
  14.  
  15. procedure TForm1.FormDestroy(Sender: TObject);
  16. begin
  17.   FImage.Free;
  18. end;
  19.  
  20. procedure TForm1.PaintBox1Paint(Sender: TObject);
  21. begin
  22.  DisplayImage(PaintBox1.Canvas, 0, 0, FImage);
  23. end;  
  24.  
« Last Edit: November 18, 2024, 09:34:40 pm by Pe3s »

 

TinyPortal © 2005-2018