Recent

Author Topic: SVG in FreePascal, or state of the art in 2D graphics  (Read 3178 times)

Handoko

  • Hero Member
  • *****
  • Posts: 5416
  • My goal: build my own game engine using Lazarus
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #15 on: March 14, 2024, 06:03:14 pm »
Basically you don't need to modify any of those files directly. Lazarus as a visual editor, will handle them behind the scene for you.

If you want to learn about those files' extensions:
https://wiki.freepascal.org/file_types

yay

  • New Member
  • *
  • Posts: 24
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #16 on: March 14, 2024, 06:05:50 pm »
Even if I don't need to modify them, I still want to be able to see them.

Handoko

  • Hero Member
  • *****
  • Posts: 5416
  • My goal: build my own game engine using Lazarus
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #17 on: March 14, 2024, 06:14:29 pm »
I am a Linux user, I can't do it. But for Windows users, you can right-click to open the folder by right clicking the line of file path near the bottom-right corner of your Source Editor:

yay

  • New Member
  • *
  • Posts: 24
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #18 on: March 14, 2024, 06:25:04 pm »
I'm on Linux and that works for me.

Still, is there really no way to just have them visible in the Project Inspector?

Handoko

  • Hero Member
  • *****
  • Posts: 5416
  • My goal: build my own game engine using Lazarus
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #19 on: March 14, 2024, 06:59:13 pm »
You can make a feature request. But I don't think much developers will be interested to implement the feature. Not because that is not useful but because Lazarus has very limited manpower. The request will be in low priority or ignored.

wp

  • Hero Member
  • *****
  • Posts: 12773
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #20 on: March 14, 2024, 07:02:37 pm »
Still, is there really no way to just have them visible in the Project Inspector?
It's good that files which are not needed by the user directly or written by the IDE are not visible normally. In a large project, the IDE will already be overflowing with your "real" source files (.pas, .pp).

Having them visible in the project inspector would mean that a double-click can open them in the editor and they will be ready for change. This will be very confusing because the user is not supposed to edit them, and if he does the changes can be ignored or even can damage the project.
« Last Edit: March 14, 2024, 07:06:50 pm by wp »

dseligo

  • Hero Member
  • *****
  • Posts: 1504
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #21 on: March 14, 2024, 07:08:59 pm »
Still, is there really no way to just have them visible in the Project Inspector?

Go to Project Inspector, click button 'Add', then 'Add ...' and choose file you want. Only I don't see a point. If you use Lazarus you use it because it is RAD IDE. If I need to open file directly, I open it through file manager.

If you want to see form source: right click on form and choose View Source (*.lfm).

cdbc

  • Hero Member
  • *****
  • Posts: 2111
    • http://www.cdbc.dk
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #22 on: March 14, 2024, 08:07:01 pm »
Hi
Take it on good advice..., there are reasons, that none of us wants to fiddle with those files:
1) The IDE does A LOT OF BOOKKEEPING!
2) The risks of messing things up to a FUBAR scale are simply to high.
If you must, use the IDE as much as you can, but be duely warned....  %)
Dolphin, Kate & KWrite are good too, but again -> be warned.
Regards Benny
« Last Edit: March 14, 2024, 08:09:35 pm by cdbc »
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

yay

  • New Member
  • *
  • Posts: 24
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #23 on: March 15, 2024, 07:35:24 am »
I can appreciate the "Here be dragons" idea, and can even sympathize with the decision that they should be invisible by default, but to have no option (aside from individually adding them manually as per dseligo's suggestion) whatsoever for viewing them within the context of the IDE is just strange to me, especially for a language that seems otherwise proud of being so close to the metal. Trust me, I will find exciting new ways to fubar my project no matter how many files you hide from me.  :P

I thought the IDE kept regular backups by default, so I fail even harder to see what the big deal is?

Having less access to dragon files than Java was not something I was expecting.
« Last Edit: March 15, 2024, 07:39:20 am by yay »

yay

  • New Member
  • *
  • Posts: 24
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #24 on: March 15, 2024, 11:19:38 am »
Code: Pascal  [Select][+][-]
  1. stretched := image.Resample(ClientWidth, ClientHeight, rmSimpleStretch) as TBGRABitmap;
  2.  

Code: Pascal  [Select][+][-]
  1. image.ResampleFilter := rfMitchell;
  2. stretched := image.Resample(ClientWidth, ClientHeight) as TBGRABitmap;
  3.  

These lines at the bottom of the second tutorial yield the errors `Error: Identifier not found "rmSimpleStretch"` and `Error: Identifier not found "rfMitchell"`, respectively.

cdbc

  • Hero Member
  • *****
  • Posts: 2111
    • http://www.cdbc.dk
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #25 on: March 15, 2024, 11:48:21 am »
Hi
Perhaps you need to include "BGRABitmapTypes" & maybe "BGRAResample"
in your uses clause...
I seem always to need the types, when I use BGRABitmap.
...Oh and don't forget the function BGRAReplace(), very nifty little gem  8-)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 3.6 up until Jan 2024 from then on it's both above &: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 4.99

Handoko

  • Hero Member
  • *****
  • Posts: 5416
  • My goal: build my own game engine using Lazarus
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #26 on: March 15, 2024, 11:50:25 am »
If he read that tutorial carefully, he will see BGRABitmapTypes is in the uses clause.

yay

  • New Member
  • *
  • Posts: 24
Re: SVG in FreePascal, or state of the art in 2D graphics
« Reply #27 on: March 15, 2024, 12:36:45 pm »
Ugh

 

TinyPortal © 2005-2018