Recent

Recent Posts

Pages: 1 ... 8 9 [10]
91
General / Re: how to convert pdf to png file
« Last post by Zvoni on September 17, 2024, 04:06:53 pm »
Correct. Good advice. But a first page would probably fit in a screenshot.
Not necessarily.
Take A4 for example: 29,7 cm high
For a 100% screenshot (no scaling involved) you'd need a Screen that high.

Scaling to fit a Screen not withstanding, but then there is "loss" involved
92
General / Re: how to convert pdf to png file
« Last post by Thaddy on September 17, 2024, 03:58:28 pm »
Correct. Good advice. But a first page would probably fit in a screenshot.
93
Audio and Video / Re: Game Music Emulator
« Last post by Guva on September 17, 2024, 03:56:07 pm »
 I see if gme_ay_type is a zx spectrum?
94
Use fpcres
 https://forum.lazarus.freepascal.org/index.php/topic,66254.0.html

Thanks! I've just tried that on a RC file that just consists of...
Code: Text  [Select][+][-]
  1. OsmosePresetData RCDATA OsmosePresetData.txt
  2.  

It errored with...
Code: Text  [Select][+][-]
  1. [Tue Sep 17 2024  2:36pm (BST+0100)]
  2. ~/Code/FPC/OsmosePresets  fpcres OsmosePresetData.rc -o OsmosePresetData.res
  3.  
  4. Error: No known file format detected for file 'OsmosePresetData.rc'
  5.  
  6. [2 - USAGE][Tue Sep 17 2024  2:37pm (BST+0100)]
  7. ~/Code/FPC/OsmosePresets
  8.  

@PascalDragon, any idea about this?
96
General / Re: how to convert pdf to png file
« Last post by loaded on September 17, 2024, 03:24:28 pm »
You mean python libraries

No, ;D

https://www.ghostscript.com/
You install this library on your computer, then you can split, merge, rotate, convert to text (limited) and convert images from lazarus via the command line.
If anyone knows another simpler and easier method, I would be happy if they shared it.
97
I just found this old thread that looked quite promising...
https://forum.lazarus.freepascal.org/index.php/topic,38585.msg262446.html#msg262446

I created an RC file...
Code: Text  [Select][+][-]
  1. OsmosePresetData RCDATA OsmosePresetData.txt
  2.  

and then used it like this...
Code: Pascal  [Select][+][-]
  1. implementation
  2.  
  3. {$R OsmosePresetData.rc}
  4.  
  5. { TPresetData }
  6.  
  7. constructor TPresetData.Create;
  8. begin
  9.   inherited;
  10.   FLines := TStringList.Create;
  11.   LoadPresetData;
  12. end;
  13.  
  14. destructor TPresetData.Destroy;
  15. begin
  16.   DestroyPresets;
  17.   Flines.Free;
  18. end;
  19.  
  20. procedure TPresetData.CreatePresets;
  21. begin
  22.   FPresets := TObjectList.Create(True);
  23. end;
  24.  
  25. procedure TPresetData.DestroyPresets;
  26. begin
  27.   FPresets.Destroy;
  28. end;
  29.  
  30. procedure TPresetData.LoadPresetData;
  31. var
  32.   rs: TResourceStream;
  33. begin
  34.   rs := TResourceStream.Create(HInstance, 'OsmosePresetData', RT_RCDATA);
  35.   try
  36.     FLines.LoadFromStream(rs);
  37.   finally
  38.     rs.Free;
  39.   end;
  40. end;
  41.  
  42. end.
  43.  

I just tried to run it and it's telling me...
Code: Text  [Select][+][-]
  1. model.pas(93,0) Error: resource compiler "windres" not found, switching to external mode
  2.  

More searching... down another few rabbit holes, no doubt  :o
98
General / Re: how to convert pdf to png file
« Last post by Prakash on September 17, 2024, 03:14:58 pm »
You mean python libraries
99
General / Re: Problems with case statement [SOLVED]
« Last post by MarkMLl on September 17, 2024, 03:02:33 pm »
Isn't that the same as saying that IfThen(Boolean,Arg1,Arg2) can be used in exchange for the ternary operator as it will be applied only to constant/simple Arg1,Arg2 expressions?

No, it's the same as saying that the compiler will reject any attempt to use it for other than simple expressions.

I believe that IfThen()'s behaviour is well documented, but in any event it can be inferred from the fact that it's a standard function which can be expected to evaluate its parameters in the same way as any other function.

The developers have- at various times in the forum etc.- told us why they don't like += . However I do not believe that these objections have been marshalled into any of the manuals, and there is definitely nothing that says "Don't use these" (which could include a deprecation or portability marker).

"In addition to the standard Pascal assignment operator (:=), which simply replaces the value of the variable with the value resulting from the expression on the right of the := operator, Free Pascal supports some C-style constructions ... These constructions are just for typing convenience, they don’t generate different code."

In what way does that constitute a "there are conditions under which this fails" warning?

MarkMLl
100
I eventually managed to build a LRS file using...
Code: Text  [Select][+][-]
  1. lazres OsmosePresetResouces.lrs OsmosePresetResouces.txt

but now I'm having problems loading it into a TResourceStream. What is the recommended way to get the data from my OsmosePresetResouces.lrs into a TStringList in my program?

I've spent the entire morning searching one rabbit hole after another, each with a different, contradictory idea. I grow weary of this  ;)

Thanks in advance!
Pages: 1 ... 8 9 [10]

TinyPortal © 2005-2018