Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
General / Re: change details Office file !
« Last post by KodeZwerg on Today at 07:05:44 am »
Hi

please help and guide me  :-[

how can i change details office file ?
By using Microsoft Office COM abilities.
Code: Pascal  [Select][+][-]
  1. program project1;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6.  SysUtils, ComObj, ActiveX;
  7.  
  8. procedure ExcelMetadata;
  9. var
  10.   ExcelApp, Workbook, Worksheet: OLEVariant;
  11. begin
  12.   ExcelApp := CreateOleObject('Excel.Application');
  13.   try
  14.     ExcelApp.Visible := False;
  15.     // path MUST be absolute
  16.     Workbook := ExcelApp.Workbooks.Open(ExtractFilePath(ParamStr(0)) + 'demo.xlsx');
  17.     Worksheet := Workbook.Worksheets[1];
  18.     WriteLn('Author: ' + Workbook.BuiltInDocumentProperties('Author').Value);
  19.     WriteLn('By hitting return, Author name will be "Lazarus COM" !');
  20.     ReadLn;
  21.     Workbook.BuiltInDocumentProperties('Author').Value := 'Lazarus COM';
  22.     Workbook.Save;
  23.     Workbook.Close;
  24.  finally
  25.     ExcelApp.Quit;
  26.  end;
  27. end;
  28.  
  29. begin
  30.   CoInitialize(nil);
  31.   try
  32.     ExcelMetadata;
  33.   finally
  34.     CoUninitialize;
  35.   end;
  36.   ReadLn;
  37. end.
If you got no Excel, I can't help.
2
General / change details Office file !
« Last post by majid.ebru on Today at 06:36:57 am »
Hi

please help and guide me  :-[

how can i change details office file ?
3
Other / Re: Forum slow
« Last post by TRon on Today at 04:26:32 am »
23 seconds after selecting login for the login window to appear and 41 seconds to actually login after entering credentials.

32 seconds to load edit form after selecting reply....

I do not even attempt to measure the preview and actual post time as session time-out is unavoidable. I call it quits for today.

I see a shiteload of "performing TLS handshaking" messages floating by.

Perhaps something changed that I need to update (though I do get these issues on a semi-rolling distro) ?
4
General / Re: Web Applications with Pascal
« Last post by egsuh on Today at 04:02:51 am »
BTW, I hope some component which emulate CSS file, which mean I edit properties of the component within Free Pascal, and the write text file to css so that it can be directly used by HTML file.
5
Other / Re: Forum slow
« Last post by 440bx on Today at 03:53:05 am »


The forum slowed down again.  It's taking 10 to 15 seconds to load a page...
6
General / Re: Web Applications with Pascal
« Last post by egsuh on Today at 03:49:52 am »
I have watched the video and my conclusion is that it does not deserve 5 seconds of your time.

Anyway, I have developed a web server with Lazarus, and its basic functions are database management and expression evaluation. Receiving requests and sending out response take relatively small parts of my whole program. And, HTML5 makes it much easier to do many things within the web-browser itself. I don't understand why people are comparing which language is better in developing web application, etc. It will depend on what functions the web server must do.
7
Graphics / Re: Demo Scene Picture sinwave
« Last post by Gigatron on Today at 03:42:01 am »
Very nice , it reminds me my shadertoy example

 https://www.shadertoy.com/view/4s3SR4
8
Graphics / Re: Demo Scene Picture sinwave
« Last post by TRon on Today at 03:22:33 am »
Let's continue with the Bitmap.PutImagePart from BGRA component, usefull now to make
flag wave or ... under 70 lines of code running for me at 60 fps, so play with....

Very nice Gigatron !!. Again a sub with many trades... let's try push it  :)

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls,
  9.   BGRAVirtualScreen, BGRABitmap;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     BGRAVirtualScreen1: TBGRAVirtualScreen;
  17.     Timer1: TTimer;
  18.     procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  19.     procedure FormCreate(Sender: TObject);
  20.     procedure FormDestroy(Sender: TObject);
  21.     procedure Timer1Timer(Sender: TObject);
  22.   private
  23.  
  24.   public
  25.  
  26.   end;
  27.  
  28. var
  29.   Form1: TForm1;
  30.   Plasma: TBGRABitmap;
  31.   acc: integer = 0;
  32.  
  33. implementation
  34.  
  35. {$R *.lfm}
  36.  
  37. uses
  38.   BGRABitmapTypes;
  39.  
  40. { TForm1 }
  41.  
  42. procedure TForm1.FormCreate(Sender: TObject);
  43. begin
  44.   Timer1.Interval := round(1000/25);
  45.   BGRAVirtualScreen1.Width := 800;
  46.   BGRAVirtualScreen1.Height := 600;
  47.   BGRAVirtualScreen1.BitmapAutoScale:=false;
  48.   Plasma := TBGRABitmap.Create('warrior1.png');
  49. end;
  50.  
  51. procedure TForm1.FormDestroy(Sender: TObject);
  52. begin
  53.   Plasma.Free;
  54. end;
  55.  
  56. procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  57. var
  58.   i : integer;
  59.   w : integer;
  60.   x : integer;
  61.   y : integer;
  62.   speed: integer = 4;
  63. begin
  64.   Bitmap.Fill(BGRAPixelTransparent);
  65.   acc := acc + 1;
  66.  
  67.   x := (BGRAVirtualScreen1.ClientRect.Width  - Plasma.ClipRect.Width)  shr 1;
  68.   y := (BGRAVirtualScreen1.CLientRect.Height - Plasma.ClipRect.Height) shr 1;
  69.  
  70.   for i := 0 to Plasma.ClipRect.Height-1 do
  71.   begin
  72.     if odd(i)
  73.      then w := round( i * sin(acc * speed * PI / 180))
  74.       else w := round( i * cos(acc * speed * PI / 180));
  75.  
  76.     Bitmap.PutImagePart
  77.     (
  78.       x + w,
  79.       y + i,
  80.       Plasma,
  81.       Rect(Plasma.ClipRect.Left , Plasma.ClipRect.Top + i, Plasma.ClipRect.Right , Plasma.ClipRect.Top + i + 1),
  82.       dmSet
  83.     );
  84.   end;
  85. end;
  86.  
  87. procedure TForm1.Timer1Timer(Sender: TObject);
  88. begin
  89.   BGRAVirtualScreen1.RedrawBitmap;
  90. end;
  91.  
  92. end.

9
Graphics / Re: Demo Scene Bitmap Font Scroller
« Last post by Gigatron on Today at 03:14:55 am »
That's clever to use the font as mask, so you can do any gradient in it.  :)
In addition I don't write all the gradient datas :)
Copper of Amiga make this gradient with skip,move and wait command, i am using Winuae to
make screenshot without antialiasing methode and extract the picture of the raster bar or copper bar.
After that i use this code to extract copper datas.

Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls,
  9.   BGRAVirtualScreen, BGRABitmap, BGRABitmapTypes ;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     BGRAVirtualScreen1: TBGRAVirtualScreen;
  17.     Memo1: TMemo;
  18.     procedure BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  19.     procedure FormCreate(Sender: TObject);
  20.     procedure FormShow(Sender: TObject);
  21.   private
  22.  
  23.   public
  24.  
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.   image  : TBGRABitmap;
  30.  
  31. implementation
  32.  
  33. {$R *.lfm}
  34.  
  35. { TForm1 }
  36.  
  37. procedure TForm1.FormCreate(Sender: TObject);
  38. begin
  39.        image := TBGRABitmap.Create('rasters.png'); // 1 pixel en y ; 640 pixel en x
  40. end;
  41.  
  42. procedure TForm1.FormShow(Sender: TObject);
  43. var  x,c : integer;
  44.      p : PBGRAPixel;
  45.      rez,final  : string;
  46. begin
  47.     c:= 0;  // data array counter
  48.     rez := '';  // store raster color data
  49.     final :=''; // final result of color data
  50.     memo1.Text :=''; // clear memo1 text
  51.  
  52.     for x := 0 to image.Width-1 do
  53.     begin
  54.       p := image.GetScanlineAt(x,0);  // scan just x to 639+1
  55.       rez := intToHex(p^.red) + intToHex(p^.green) + intToHex(p^.blue);  // extract r,g,b component ;
  56.       final := final + QuotedStr('#'+rez) +',' ;
  57.       c:= x;
  58.     end;
  59.       SetLength(final,length(final)-1); // remove last char :
  60.       memo1.Text := 'const ' + #13#10;
  61.       memo1.Text := memo1.Text  + 'raster_data :Array[0..'+intToStr(c)+'] of String =('  + final + ');' ;
  62.  
  63. end;
  64.  
  65. procedure TForm1.BGRAVirtualScreen1Redraw(Sender: TObject; Bitmap: TBGRABitmap);
  66. begin
  67.        Bitmap.Canvas2D.drawImage(image,0,0,640-1,160,rfLinear); // stretch a bit ;
  68. end;
  69.  
  70. end.
  71.  

10
General / Re: open dialog - default directory
« Last post by jamie on Today at 02:24:45 am »
I believe the problem that is happening is that the "InitialDir" gets changed to the path when the dialog closes and thus is no longer valid.
 
 So if you were to reuse this value later on in code, it will not be as it was.

 You can see this in the dialog code if it finds a path in the FILENAME it resets the "InitialDir" to that path.

Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018