Re: [Lazarus] Docked Form
2015-06-15 14:31 GMT+02:00 Graeme Geldenhuys: > How is that going to look under OSX where tabs are very different (read > as butt ugly and rubbish) compared to other platforms? You can check this. :) First version with "Sparta Basic" (docked design form and IDE changes) :D is available at: http://svn.freepascal.org/svn/lazarus/branches/free-sparta http://svn.freepascal.org/cgi-bin/viewvc.cgi/branches/free-sparta/?root=lazarus Best regards, Maciej Izak -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
On Wed, 8 Jul 2015, Graeme Geldenhuys wrote: On 2015-07-08 22:30, aradeonas wrote: I test the code but app will wait for more than a minute and so on on "img.UsePalette := True;" and I couldn't get values. It took a while here... just under a minute, but then it started writing out all the RGB values. So it works, but it just ain't fast because the palette is huge (as expected). Well, I have faster palette creation on my list. But it will always take a while, since the palette will be huge in each case. A palette with too many colors is nonsense anyway. Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
So in my case BGRABitmap is a better choice,because I could choose color count. Thank you Michael and Graeme as always. Regards, Ara -- http://www.fastmail.com - Faster than the air-speed velocity of an unladen european swallow -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
On 2015-07-08 22:30, aradeonas wrote: > I test the code but app will wait for more than a minute and so on on > "img.UsePalette := True;" and I couldn't get values. It took a while here... just under a minute, but then it started writing out all the RGB values. So it works, but it just ain't fast because the palette is huge (as expected). Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
My bad! I test the code but app will wait for more than a minute and so on on "img.UsePalette := True;" and I couldn't get values.I test that image in Lazarus/FPC Trunk 2015/06/27 49452. Regards, Ara -- http://www.fastmail.com - Same, same, but different... -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
On Wed, 8 Jul 2015, aradeonas wrote: Here you are. http://lokeshdhakar.com/projects/color-thief/img/photo1.jpg Your program contained an error, I should have seen it at once. You used TFPCustomImage. This is an abstract class. You should have used a descendent like TFPMemoryImage instead. ( the compiler warns you: testpalette.lpr(10,37) Warning: Constructing a class "TFPCustomImage" with abstract method "SetInternalPixel" ) So: program testpalette; uses fpimage,fpreadjpeg; var i: Integer; Img: TFPCustomImage; begin Img := TFPMemoryImage.Create(0, 0); try img.LoadFromFile('photo1.jpg'); img.UsePalette := True; for i := 0 to img.Palette.Count-1 do With img.Palette.Color[i] do Writeln(red,',',green,',',blue); finally Img.free; end; end. Works as expected. Michael. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
Here you are. http://lokeshdhakar.com/projects/color-thief/img/photo1.jpg Ara -- http://www.fastmail.com - The professional email service -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
On Wed, 8 Jul 2015, aradeonas wrote: Project project1 raised exception class 'External: SIGSEGV'. File exists and it is correct. Can you send me the file ? Michael.-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
For now I used lovely BGRABitmap like this,thanks to its author circular. > uses BGRABitmap, BGRABitmapTypes, BGRAColorQuantization; > > var bmp:TBGRABitmap; quant: TBGRAColorQuantizer; i: Integer; begin > bmp:=TBGRABitmap.Create('E:\photo1.jpg'); quant := > TBGRAColorQuantizer.Create(bmp, acIgnore, 5); for i := 0 to > quant.ReducedPalette.Count- > 1 do begin with TPanel.Create(Self) do begin Parent := > Self; Align := alTop; > Color:=BGRAToColor(quant.ReducedPalette.Color[i]); end; end; > Regards, Ara -- http://www.fastmail.com - Faster than the air-speed velocity of an unladen european swallow -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] File sync system approach
[Cross posted on forum so if you want answer there : http://forum.lazarus.freepascal.org/index.php/topic,29007.0.html] Hi, For one of my projects I want to send and receive files between server and client and for years I saw demos in Indy,Synapse ... but I wonder if any one done it in real world and have experience or suggestion that want to share with so prevent me to go wrong or reinvent wheel or engine if they are out. I want to know what is the best approach for making a sync system,what is the powerfullest library and live library,tips to know about security or even file changes recognition and upload just changed part like DropBox. I don't want all,just if you can help me in some part please do. Regards -- http://www.fastmail.com - Accessible with your email software or over the web -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
> Project project1 raised exception class 'External: SIGSEGV'. File exists and it is correct. Ara -- http://www.fastmail.com - Email service worth paying for. Try it for free -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
On Wed, 8 Jul 2015, aradeonas wrote: Thank you. I get exception when try to load from file and I could not debug in FPC source,debugger don't go there: var i: Integer; Img: TFPCustomImage; reader: TFPCustomImageReader; begin Img := TFPCustomImage.Create(0, 0); Reader := TFPReaderJPEG.Create; img.LoadFromFile('E:\photo1.jpg',Reader); img.UsePalette := True; for i := 0 to img.Palette.Count do begin with TPanel.Create(Self) do begin Parent := Self; Align := alTop; Color:=FPColorToTColor(img.Palette.Color[i]); end; end; end; What is the exception you get ? The loading should go automatically, provided you have included the necessary reader files (fpreadjpeg.pas) in your uses clause. Michael.-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
Thank you. I get exception when try to load from file and I could not debug in FPC source,debugger don't go there: > var i: Integer; Img: TFPCustomImage; reader: TFPCustomImageReader; > begin Img := TFPCustomImage.Create(0, 0); Reader := > TFPReaderJPEG.Create; img.LoadFromFile('E:\photo1.jpg',Reader); > img.UsePalette := True; for i := 0 to img.Palette.Count do begin > with TPanel.Create(Self) do begin Parent := Self; Align > := alTop; Color:=FPColorToTColor(img.Palette.Color[i]); end; > end; end; > Also is there a class to do file loading with readers automatically like TImage? Tlazintfimage seems not does this . yes its not hard to implement it but as just now I find out there is many things in Lazarus and FreePascal that I'm not aware of them! Regards, Ara -- http://www.fastmail.com - Access your email from home and the web -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Is there a bug in auto indentation in 1.4 or is it just me?
On 08/07/2015 10:51, Bernd wrote: I cannot find any way to influence this behavior in the editor settings (which are very confusing btw), I cannot even change anything at all there, even if I set everything to 4 spaces instead of 2 it will still use 2 spaces everywhere (and 4 in an else begin branch). Is this just me or is this a bug in the 1.4 release? You probably have "smart indent" on (see codetools section of config). The editor section has a link that takes you there too. afaik the smart indent takes it rules from a sample source in the config path... -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Color thief
On Wed, 8 Jul 2015, aradeonas wrote: Hi, Today I saw Color thief and I was impressed.I like to have something like this in my application so I reviewed the code but I dont know how to implement this in FreePascal or couldn't find anything like this in Pascal that do as good as this. Any one know about a library like this in Pascal or Delphi or probably write similar to this? TFPCustomImage can do this for you. Load the image, set UsePalette:=True, and then the palette is available in the Palette property. Michael.-- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Color thief
Hi, Today I saw Color thief[1] and I was impressed.I like to have something like this in my application so I reviewed the code but I dont know how to implement this in FreePascal or couldn't find anything like this in Pascal that do as good as this. Any one know about a library like this in Pascal or Delphi or probably write similar to this? Regards, Ara Links: 1. https://github.com/lokesh/color-thief -- http://www.fastmail.com - Choose from over 50 domains or use your own -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Is there a bug in auto indentation in 1.4 or is it just me?
if I write the following code: procedure foo; begin if true then begin X end else begin X end; end; The "x" marks the place where it puts my cursor after hitting enter. After the the if then begin it will correctly place me 2 spaces indented relative to the begin, but after the end else begin it will place me 4 spaces relative to the begin. I cannot find any way to influence this behavior in the editor settings (which are very confusing btw), I cannot even change anything at all there, even if I set everything to 4 spaces instead of 2 it will still use 2 spaces everywhere (and 4 in an else begin branch). Is this just me or is this a bug in the 1.4 release? Bernd -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] lazbuild not bıild IDE
Yes, you right Sandro this is my commandline in my script lazbuild --quiet --max-process-count=8 --pcp=/Users/$User_Name/.lazarus --build-all --skip-dependencies --build-ide= --ws=$LCL_PLATFORM --cpu=$CPU_TARGET $COMPILERSWITCH " I added --pcp 'cos some times change it for test. --quiet is symbolic :) 'cos all warnings and hints printing. On 07.07.2015 23:52, Sandro Cumerlato wrote: It looks like the lazbuild stdout message for the parameter: --primary-config-path= or --pcp= primary config directory, where Lazarus stores its config files. Default is $HOME/.lazarus I use it too for my usb stick portable environment. Sandro -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] lazbuild not bıild IDE
Thank you, its worked in r49509. On 07.07.2015 19:41, Juha Manninen wrote: Ok, sorry, there was an error indeed. Try with r49509. Should work now. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] lazbuild not bıild IDE
Yes, its in terminal, first output line of lazbuild, not mine parameter, or commandline On 07.07.2015 19:24, Juha Manninen wrote: On Tue, Jul 7, 2015 at 6:53 PM, FreeMan wrote: >in terminal: >SetPrimaryConfigPath NewValue="/Users/freeman35/.lazarus" -> >"/Users/freeman35/.lazarus" Is that your command line? What does it do? Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus