Author
Topic: New version of BGRABitmap (Read 90279 times)

- Text hint / placeholder on all platforms (Qt, Gtk, Windows). This is a hint which is showed when edit text is empty. Normally only Gtk (ver 3+) and Qt has it, but due that windows edit doesn't, LCL is not publishing this property

- Text hint / placeholder on all platforms (Qt, Gtk, Windows). This is a hint which is showed when edit text is empty. Normally only Gtk (ver 3+) and Qt has it, but due that windows edit doesn't, LCL is not publishing this property

BGRABitmap uses the underlying OS to produce fonts. However it tries to look the same on all platforms. You can have a try simply in a window, to draw text, measure it, etc. and if you find it give acceptable results for you, then it is ok. If there are differences between OS's, I would be happy to know about it.

bmp.Draw(Canvas,0,0); bmp.Free;end;To define an arrow, use ArrowStartAs... and ArrowEndAs...

Some properties are there to customise the head/tail:- ArrowStartRepeat is the number of repetition of the arrow head/tail. The default value is 1.- ArrowStartOffset is the offset of the head/tail relative to the start of the line, one unit being equal to the width of the line. The default value is 0.- ArrowStartSize is the size of the arrow head, one unit being equal to the width of the line. The default value is PointF(2,2)

ArrowEnd... and ArrowStart... are the same except ArrowEnd is relative to the end of the line

The arrows are applied to DrawLineAntialias and DrawPolyLineAntialias functions

3d renderingIt is essentially an upgrade to support more OBJ files :- it is possible now to define custom normals- negative vertex reference has been added- loading materials from MTL file (using LoadMaterialsFromFileUTF8 function)

Often, the material file has the same name as the object file, so you can get the correct filename:

materialFilename := ChangeFileExt(objectFilename,'.mtl')Color quantizationThis goes with new classes to handle palettes. In BGRAPalette unit, there are different kind of palettes. The types you are likely to create are :- TBGRAPalette: a palette where you can add and remove colors- TBGRAWeightedPalette: a palette where each color has a weight. So if you add the same color multiple times, its weight increases

In order to reduce the number of colors or to save a bitmap to a file with a small number of colors, the class TBGRAColorQuantizer is available BGRAColorQuantization unit.

First instantiate TBGRAColorQuantizer with a bitmap or a palette. It will procude a reduced palette. The maximum number of color in this palette is defined by the property ReductionColorCount (by default 256). There are different ways to handle transparency, indicated by TAlphaChannelPaletteOption :- acIgnore: it means alpha channel is considered separately from the color- acTransparentEntry: it means that one entry in the palette will be the transparent color, with alpha = 0- acFullChannelInPalette: it means that there will be if necessary a gradient of alpha values represented in the palette (this is recommended for example if you save in PNG format)

For BGRABitmap itself, there is not much on the todo list. There are possible improvements in different areas : SVG format, GIF format, font handling, grayscale bitmap stored in memory, more file formats. However none of those are essential nor have I received any request in that direction, except one minor request for line spacing with text rendering.

For LazPaint, I am adding new features and hope to release a new version soon.

Thanks but I have request for you If we have more vector tools like SVG format and adding them to Canvas2D it will be great.I like vector UI very much.Also a big thing that I think BGRABitmap need is documentation and more demos maybe because for someone like me is hard to learn and all I learned is from demos that you made in old BGRABitmap topics and demos in old LazPaint package.Also a new home like a website will be good.Because when I talk to developers most of them don't know BGRABitmap is exists and one of my reason in working with Lazarus is BGRABitmap so more people know it more request come PS,tutorial is not enough for this beautiful world.