Recent

Author Topic: LazPaint (alpha-blending, antialiasing, filters)  (Read 527001 times)

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #780 on: July 22, 2015, 09:51:09 pm »
How wow, well when I solve it myself, I take something like 1 minute!
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3931
  • Leandro Diaz
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #781 on: July 23, 2015, 12:25:11 am »
Nice! you are fast too!

lainz

  • Hero Member
  • *****
  • Posts: 3931
  • Leandro Diaz
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #782 on: August 02, 2015, 04:40:00 am »
Hi, this is the uonline.pas using fphttpclient.

It downloads the file to string and saves the lazpaint settings, but never show the new version dialog.

fphttpclient unit is not by default threaded, you must create a separate thread to make the download, and I've not included that.

Edit:

So this unit I changed is not so usefull -_- at least is usefull to know how not to do it.
« Last Edit: August 02, 2015, 06:11:37 am by lainz#007 »

lainz

  • Hero Member
  • *****
  • Posts: 3931
  • Leandro Diaz
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #783 on: August 02, 2015, 06:11:00 am »
BTW this is the way I use to download a file with a thread using fphttpclient, maybe you already know it but I put it here ;)

Code: [Select]
unit Unit1;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  fphttpclient;

type

  { TForm1 }

  { TDownloadFile }

  TDownloadFile = class(TThread)
  protected
    procedure Execute; override;
  end;

  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure FormCloseQuery(Sender: TObject; var CanClose: boolean);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
    DownloadT: TDownloadFile;
    procedure OnTerminate(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.lfm}

{ TForm1 }

procedure TForm1.Button1Click(Sender: TObject);
begin
  Button1.Enabled := False;
  FreeAndNil(DownloadT);

  DownloadT := TDownloadFile.Create(False);
  DownloadT.OnTerminate := @OnTerminate;
end;

procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: boolean);
begin

end;

procedure TForm1.FormCreate(Sender: TObject);
begin

end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
  FreeAndNil(DownloadT);
end;

procedure TForm1.OnTerminate(Sender: TObject);
begin
  if FileExistsUTF8(ExtractFilePath(ParamStr(0)) + 'File.html') then
    ShowMessage('File.html saved!');
  Button1.Enabled := True;
end;

{ TDownloadFile }

procedure TDownloadFile.Execute;
var
  TheFile: TStringList;
begin
  try
    TheFile := TStringList.Create;
    TFPHTTPClient.SimpleGet('http://lazpaint.sourceforge.net/latest.txt',
      TheFile);
    TheFile.SaveToFile('File.html');
  finally
    TheFile.Free;
  end;
end;
           

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #784 on: August 02, 2015, 10:49:11 am »
Thanks 007!
Conscience is the debugger of the mind

Sait™

  • New member
  • *
  • Posts: 7
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #785 on: April 17, 2016, 02:17:18 pm »
I have tried bgrabitmap library of lazpaint. I create Tbgrabitmap, but I can't create it with background is transparent although I create with clNone. Can u give me a suggestion, plz?

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #786 on: April 17, 2016, 08:33:04 pm »
Hello!

Just create it with Width,Height and no parameter for color.  8-)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3931
  • Leandro Diaz
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #787 on: April 19, 2016, 10:55:57 pm »
Hi, now Lazarus 1.6 has support for drawing on TToolBar and TToolButton, this can be used to theme that part of any application. LazPaint uses toolbar and tool buttons, so the idea is to provide some custom theme for that components. Is just an idea.

The main problem is that there is no single toolbar but multiple toolbars inside panels, maybe that difficults something the task or breaks the continuity of the toolbar into small ones.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.ToolBar1Paint(Sender: TObject);
  2. begin
  3.   //toolbar painting code
  4. end;
  5.  
  6. procedure TForm1.ToolBar1PaintButton(Sender: TToolButton; State: integer);
  7. begin
  8.   //button painting code
  9. end;

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #788 on: April 19, 2016, 11:28:23 pm »
That's good to know. Thank you!  :)
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3931
  • Leandro Diaz
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #789 on: May 01, 2016, 10:42:06 pm »
That's good to know. Thank you!  :)

Try this one, only is missing the drawing of the icons.

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #790 on: May 02, 2016, 10:48:04 am »
Quite nice!

It looks definitely like Photoshop.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3931
  • Leandro Diaz
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #791 on: May 02, 2016, 06:11:32 pm »
Quite nice!

It looks definitely like Photoshop.

Is perfectly the same as Adobe Flash (the old flash editor..). Photoshop has rounded corners and doesn't have the mouse over pressed state "MouseButtonPressedHover".

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #792 on: May 05, 2016, 09:26:53 pm »
Hi!

Done on SVN : LazPaint does not depend on LNet anymore but use TFPHTTPClient to get updates.
Conscience is the debugger of the mind

lainz

  • Hero Member
  • *****
  • Posts: 3931
  • Leandro Diaz
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #793 on: May 05, 2016, 10:20:41 pm »
Hi!

Done on SVN : LazPaint does not depend on LNet anymore but use TFPHTTPClient to get updates.

You forget to remove project dependency on lnetvisual (project > inspector...)

circular

  • Hero Member
  • *****
  • Posts: 3648
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #794 on: May 06, 2016, 12:42:12 am »
I've updated the .LPI project file. Does that fix the dependency?
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018