Recent

Author Topic: LazPaint features request, ideas, wishes  (Read 26153 times)

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint features request, ideas, wishes
« Reply #30 on: May 20, 2016, 01:21:14 am »
That's not as simple. You would need to create a custom component to override the erase background event. That's why I am suggesting to use TBGRAVirtualScreen or TBGRAGraphicControl.
Conscience is the debugger of the mind

staratel20

  • Full Member
  • ***
  • Posts: 206
Re: LazPaint features request, ideas, wishes
« Reply #31 on: May 20, 2016, 10:28:38 am »
But wait a minute - this example I did, - is based on TBGRAVirtualScreen (named VS).
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint features request, ideas, wishes
« Reply #32 on: May 20, 2016, 04:28:41 pm »
Oh I see. Apologies!

So to write it in a portable way, you would do the following:
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  9.   BGRAVirtualScreen, BGRABitmap, BGRABitmapTypes;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     Timer1: TTimer;
  17.     vs: TBGRAVirtualScreen;
  18.     procedure FormCreate(Sender: TObject);
  19.     procedure Timer1Timer(Sender: TObject);
  20.     procedure vsRedraw(Sender: TObject; Bitmap: TBGRABitmap);
  21.   private
  22.     { private declarations }
  23.   protected
  24.     lineX:integer;
  25.     c:TBGRAPixel;
  26.   public
  27.     { public declarations }
  28.   end;
  29.  
  30. var
  31.   Form1: TForm1;
  32.  
  33. implementation
  34.  
  35. {$R *.lfm}
  36.  
  37. { TForm1 }
  38.  
  39. procedure TForm1.FormCreate(Sender: TObject);
  40. begin
  41.   vs.Color := clBlack;
  42.   lineX := 0;
  43.   c := BGRAWhite;
  44. end;
  45.  
  46. procedure TForm1.Timer1Timer(Sender: TObject);
  47. begin
  48.   inc(lineX);
  49.   vs.DiscardBitmap;
  50. end;
  51.  
  52. procedure TForm1.vsRedraw(Sender: TObject; Bitmap: TBGRABitmap);
  53. begin
  54.   Bitmap.DrawLine(lineX,10,lineX,60,c,True);
  55. end;
  56.  
  57. end.
Conscience is the debugger of the mind

staratel20

  • Full Member
  • ***
  • Posts: 206
Re: LazPaint features request, ideas, wishes
« Reply #33 on: May 22, 2016, 08:56:28 pm »
Thanks, code works fine.

By the way:
Code: Pascal  [Select][+][-]
  1. vs.DiscardBitmap;
why don't:
Code: Pascal  [Select][+][-]
  1. vs.cls
lazy programmers will thank you :)
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint features request, ideas, wishes
« Reply #34 on: May 23, 2016, 01:39:23 am »
Because there is DiscardBitmap and RedrawBitmap.

DiscardBitmap just releases the current content, and wait for an OnPaint event.

RedrawBitmap redraws the content straight away.

Depending on the situation, you may want one rather than the other.
Conscience is the debugger of the mind

c-sanchez

  • Jr. Member
  • **
  • Posts: 65
Re: LazPaint features request, ideas, wishes
« Reply #35 on: May 25, 2016, 03:47:03 am »
Very good all news! :D
About TIM images, another (i think) usefull tool can be this one
http://www.moddb.com/mods/blood-omnicide/downloads/blood-pill-v109
You can found Blood Pill src on github :)
https://github.com/paulvortex/BloodPill
So the TIM images are used on pc games also psx :)

Btw i have the doubt, on next release is fixed the docking of layers and colors? the docking of tools was nice, but was very weird the solution on layers and colors hehe.
« Last Edit: May 25, 2016, 04:10:36 am by c-sanchez »

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint features request, ideas, wishes
« Reply #36 on: May 25, 2016, 09:06:44 pm »
Ahah yes, I admit the docking of layers and colors is weird!  8-)
Conscience is the debugger of the mind

staratel20

  • Full Member
  • ***
  • Posts: 206
Re: LazPaint features request, ideas, wishes
« Reply #37 on: June 17, 2016, 05:52:31 pm »
I think is the bad idea to separate windows of selection color, layers , etc. Because nobody(I think) feel comfort to move this windows "from there to there" during the paint process. Maybe solution is to create one Dock-site window, called "Tools" (or something like) and Dock all to them when program starting. Also be good to have a little button somewhere to jump this windows to left side, and when pressing again - to right side. Or even not button - Right-click(RMB) on window header make window jump to another side.

Also want to notice, that when you working with photo or something image with semitones - much comfort use RMB for picking color from image pixel, than set second color(like it realized now).

Minor bug: when working with jpeg image and than click on window-close button, - program ask you about saving changes. If click Yes, but program can't overwrite exiting file by some reason(it opening in another program) - program will exit and changes will be lost.

But the good news exists! Before this time I analyze Lazpaint only abstract(not on the real task). But on real task I feel very comfort with it and want to thank you.

Thanks! : )
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

staratel20

  • Full Member
  • ***
  • Posts: 206
Re: LazPaint features request, ideas, wishes
« Reply #38 on: June 17, 2016, 09:19:39 pm »
Almost forget - be very good to have ability to scroll image for any corner of image put in screen center.
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

staratel20

  • Full Member
  • ***
  • Posts: 206
Re: LazPaint features request, ideas, wishes
« Reply #39 on: June 29, 2016, 02:02:37 pm »
Already realize by myself picking color by RMB when pencil tool is active:

Code: Pascal  [Select][+][-]
  1. procedure TFMain.FormMouseDown(Sender: TObject; Button: TMouseButton;
  2.   Shift: TShiftState; X, Y: Integer);
  3. begin
  4.   ReleaseMouseButtons(Shift);
  5.   if not (Button in[mbLeft,mbRight,mbMiddle]) then exit;
  6.   CanCompressOrUpdateStack := false;
  7.   Image.OnImageChanged.DelayedStackUpdate := True;
  8.  
  9.   if btnLeftDown or btnRightDown or btnMiddleDown then exit;
  10.  
  11.   if Button = mbLeft then
  12.     btnLeftDown := true else
  13.   if Button = mbRight then
  14.     btnRightDown := true else
  15.   if Button = mbMiddle then
  16.   begin
  17.     btnMiddleDown:= true;
  18.     if not ToolManager.ToolSleeping then ToolManager.ToolSleep;
  19.   end;
  20.  
  21.   if btnRightDown and (CurrentTool=ptPen) then
  22.   begin
  23.     ToolManager.SetCurrentToolType(ptColorPicker);
  24.     ToolManager.ToolDown(FormToBitmap(X,Y),btnLeftDown);
  25.     ToolManager.SetCurrentToolType(ptPen);
  26.     UpdateToolbar;
  27.     exit;
  28.   end;
  29.  
  30.   if ToolManager.ToolDown(FormToBitmap(X,Y),btnRightDown) then
  31.       PaintPictureNow;
  32.   UpdateToolbar;
  33. end;  


And ability to change pencil size with Ctlr+MouseWheel:

Code: Pascal  [Select][+][-]
  1. procedure TFMain.FormMouseWheel(Sender: TObject; Shift: TShiftState;
  2.   WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
  3. begin
  4.   if Shift=[] then
  5.   begin
  6.     Zoom.SetPosition(FormToBitmap(MousePos.X,MousePos.Y), MousePos);
  7.     if WheelDelta > 0 then Zoom.ZoomIn else
  8.     if WheelDelta < 0 then Zoom.ZoomOut;
  9.     Zoom.ClearPosition;
  10.     Handled := True;
  11.   end;
  12.  
  13.  
  14.   if Shift=[ssCtrl] then
  15.   begin
  16.     if WheelDelta>0 then
  17.     begin
  18.       if SpinEdit_PenWidth.Value-PenSizeDelta(WheelDelta)>SpinEdit_PenWidth.MaxValue then
  19.         SpinEdit_PenWidth.Value:=SpinEdit_PenWidth.MaxValue
  20.       else
  21.         SpinEdit_PenWidth.Value:=SpinEdit_PenWidth.Value+PenSizeDelta(WheelDelta);
  22.     end else
  23.     begin
  24.       if SpinEdit_PenWidth.Value-PenSizeDelta(WheelDelta)<SpinEdit_PenWidth.MinValue then
  25.          SpinEdit_PenWidth.Value:=SpinEdit_PenWidth.MinValue
  26.       else
  27.          SpinEdit_PenWidth.Value:=SpinEdit_PenWidth.Value-PenSizeDelta(WheelDelta);
  28.     end;
  29.     Handled := True;
  30.   end;
  31.  
  32. end;
     
... so everybody can enjoy it : )
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

staratel20

  • Full Member
  • ***
  • Posts: 206
Re: LazPaint features request, ideas, wishes
« Reply #40 on: June 30, 2016, 08:51:39 am »
Want to add one note about spline. When I draw a spline it always drawn as "closed". Be good to draw it not closed, but if mouse idle a second or two - draw closed.

...and about selecting with pen - think better draw a circle as in pen-mode instead of changing mouse cursor(because if I use Ctrl+Wheel to change radius of pen I don't see new actual radius)
« Last Edit: June 30, 2016, 08:55:04 am by staratel20 »
Windows 7 SP1 x64, FPC 3.0.0, Lazarus from trunk: http://svn.freepascal.org/svn/lazarus/trunk

CountIdentity, ModeClassName - good property naming
IdentityCount,  ClassNameMode  - bad property naming

c-sanchez

  • Jr. Member
  • **
  • Posts: 65
Re: LazPaint features request, ideas, wishes
« Reply #41 on: July 31, 2016, 08:07:56 pm »
Hi circular! some new feature requests to LazPaint.

* Please add a Yin Yang, err, a Lighten/Darken tool.
https://s6.postimg.org/buy7dnqk1/Ying_Yang_Lighten_Darken.gif

* The LazPaint Erase tool have Erase and Smooth, i see this nice indeed, but can you add also the called "Smudge" or "Finger" tool too?
https://s6.postimg.org/6xkmsjokx/Ying_Yang_Smudge.gif

Both tools are usefull to play with the colors.

Btw, i saw on forum some comments about BGRABitmap and Vectors, so have you considered making lazpaint a vector editor too?
Must be nice do vectors on LazPaint, although I'm not sure how easy it is to add that heh :P

Anyway if you wish, check RealWorld Paint, is a interesting image editor because you can work with Raster and Vectorial layers on same project.

How looks the editor with a Vector layer and a Raster layer
https://s6.postimg.org/8t7f3pdf5/vector_raster.png

Same image created on RWPaint exported as SVG
http://svgur.com/s/90

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: LazPaint features request, ideas, wishes
« Reply #42 on: July 31, 2016, 08:10:32 pm »
Hmmm, yes I have seen RealWorld Paint. In fact I was thinking about importing files from this program as well.

Regarding the vector tools, well, err, I am thinking about it. Not so sure how much I will be able to achieve for next version of LazPaint.
Conscience is the debugger of the mind

c-sanchez

  • Jr. Member
  • **
  • Posts: 65
Re: LazPaint features request, ideas, wishes
« Reply #43 on: July 31, 2016, 08:26:28 pm »
Ohh, cool!
haha first phoxo and now rwpaint support?  :o
heh so you have the idea to make lazpaint full compatible with other editors?
buy yeah, i guess this is too many  in the short term, if you have plans to release a new version of lazpaint soon.

mrguzgog

  • Jr. Member
  • **
  • Posts: 71
Re: LazPaint features request, ideas, wishes
« Reply #44 on: July 31, 2016, 11:29:05 pm »
The canvas size dialog needs some attention imho - it's not possible to remove the first digit when it is '1' until more numbers are entered. If I try to change the default 128x128 image to 300x300 I end up having 1300... and have to move to/delete the first digit. Sorry if that explanation isn't brilliant!

Also, the Color and Layers dialogs stay on top of all apps unless Lazpaint is minimized (I have them floating over my browser now!) - somehow they need to stop being 'always on top'.

I'm on Linux Mint 64 bit.

 

TinyPortal © 2005-2018