-
Content Count
523 -
Joined
-
Last visited
-
Days Won
6
Posts posted by Vandrovnik
-
-
Bitmap1.ScanLine[Bitmap1.Height-1] is start of the image buffer (raw image data, it is bottom up).
Buffer size is not so easy; in VCL.Graphics, they have this function (Alignment=32; you need to multiply its result by Bitmap1.Height; look at TBitmap.GetScanLine in VCL.Graphics).
function BytesPerScanline(PixelsPerScanline, BitsPerPixel, Alignment: Longint): Longint; begin Dec(Alignment); Result := ((PixelsPerScanline * BitsPerPixel) + Alignment) and not Alignment; Result := Result div 8; end;
-
Hello,
I wanted to call tDictionary<>.SetCapacity prior to adding items to it, so that there is no need to re-hash items. Unfortunatelly, tDictionary<>.SetCapacity is private member. Why? Is it an intention, or a bug? Probably there is a way how to access even a private method...?
Kind regards,
Karel
-
1 hour ago, Angus Robertson said:If anyone has any real IDN URLs they would be useful for testing.
www.háčkyčárky.cz by CZ Domain Registry.
-
On https://www.xn--hkyrky-ptac70bc.cz/ , there is an e-mail address to which you can send test e-mails and it should send you a reply, if test message was OK. (You can switch the site to English language.)
-
When you are up-to-date with Delphi, it is easier to accomodate the software to new demands (such as was UTF or HDPI in the past, may be 64 bit in the future - hard to say how many years 32bit apps will be supported, new encryptions etc).
Move software to another language will cost a lot of money and time (and new bugs and old features missing in the beginning).
- 1
-
5 hours ago, Serge_G said:Agree with NIRAV KAKU in the principle but anyway if you want to access LiveBinded fieldname of a column, fieldname is the wrong name you have to search a membername.
Thank you for helping me to get the right way!
-
So, partial solution... Works with field names (does not depend on headers), works when columns are moved. Works, when data is reloaded from database. But does not keep column width, when user changes the width in runtime (I did not find any event for column width change).
// defined as private member in form: grZasobaLink: TLinkGridToDataSource; // I do not know how to obtain BindingsList directly from the StringGrid, so I am passing it as param function GetLinkToDataSource(aBindingsList: tBindingsList; aGrid: tStringGrid): TLinkGridToDataSource; var a: integer; BindComponent: tContainedBindComponent; begin result:=nil; if (aBindingsList=nil)or(aGrid=nil) then exit; for a:=0 to aBindingsList.BindCompCount-1 do begin BindComponent:=aBindingsList.BindComps[a]; if (BindComponent.ControlComponent=aGrid)and(BindComponent is tLinkGridToDatasource) then begin result:=tLinkGridToDatasource(BindComponent); exit; end; end; end; // keep the link, since I will need it often procedure TZasobaForm.FormCreate(Sender: TObject); ... grZasobaLink:=GetLinkToDataSource(BindingsList1, grZasoba); end; procedure TZasobaForm.grZasobaDrawColumnCell(Sender: TObject; const Canvas: TCanvas; const Column: TColumn; const Bounds: TRectF; const Row: Integer; const Value: TValue; const State: TGridDrawStates); var FieldName: string; begin Canvas.Font.Size:=grZasoba.TextSettings.Font.Size; if Assigned(grZasobaLink) then FieldName:=UpperCase(grZasobaLink.Columns[Column.Index].MemberName) // Field name! :-) else FieldName:=''; if (FieldName='FYZICKA') then begin Canvas.Font.Style:=[tFontStyle.fsBold]; end; Canvas.Fill.Color:=TAlphaColorRec.Black; Canvas.FillText(Bounds, (Value.AsString), false, 1, [], TTextAlign.Leading, TTextAlign.Center); end; // handle column move procedure TZasobaForm.grZasobaColumnMoved(Column: TColumn; FromIndex, ToIndex: Integer); begin if Assigned(grZasobaLink) then grZasobaLink.Columns[FromIndex].Index:=ToIndex; end;
-
I suppose this information already is stored somewhere, so I would like to find it and use it. I cannot rely on the header, but of course I could use tag, build my own list or something like that.
It seems that this connection between tStringGrid and data is also partly broken - well, in runtime I can move columns and set their width with mouse, but when the grid is filled again, order and width of columns are lost (this happens in my case when user selects another master record - data for details in the grid has to reload from database, columns where supposed to keep their position and width).
-
51 minutes ago, dummzeuch said:You must keep in mind that Embarcadero only occasionally syncs the public jira with their internal one. Usually just before a new release lots of entries get closed. Unfortunately that does not always mean that they have been fixed.
I know, but from these graphs it is still pretty well visible, that issues stay in the queue/stack/whatever longer and longer and that new issues come faster then old issues are resolved. 800 days and increasing, that is a terrible value.
I understand they they want to keep up to date with new Android, new iOS etc., but still I believe that they should have a team, which will resolve reported bugs.
-
8 minutes ago, FredS said:There are of course other things to consider. Bugs converted to Feature Requests, and then there is that Dark Pool of internal Bugs that get resolved by the hundreds..
I know... And bugs resolved as "will not repair" (ie Translation Manager), bugs marked as duplicate... But the tendency in the graph is the same as my internal feeling in last years.
-
-
7 hours ago, Stefan Glienke said:As for the publicly reported issues you can easily put that together yourself on the quality portal (JIRA) dashboard.
Well, I tried - but when I use (the top one) Export - Excel (all fields), it exports only 1000 issues of more then 16000... May be there is a better way and I just do not see it.
-
3 hours ago, Anders Melander said:3) People assuming they know how and why Embarcadero prioritize as they do.
It's easy to sit here and bitch about this and that, when you're not the one responsible for these things. IMO it's just noise.
May be Embarcadero could explain how they decide what to do and what to postpone... and postpone...? Because when I compare Embarcadero with TMS or Fastreport (or you), it is often reaction several years vs. several days, which I really do not like. Even https://quality.embarcadero.com/browse/RSP-24548, which should take +- 2 minutes to repair, will probably be there open for years. And please do not argument that it will take much more time because of testing, because the "testing" I can see each day in Object Inspector, which is not showing last letters in text (reported more than a year ago, but did they notice by themselves when testing?), and in Projects (which stops to show its content in 10.3.3 sometimes), and in Toolbars, which are moved randomly each day...
I would like to see a statistic, how reported and solved issues develop over years. May be it is somewhere on the web, I do not know.
-
8 minutes ago, Remy Lebeau said:You are on the right track. You need to use the Column parameter. In this case, you can use the TColumn.Header property to know which column is being drawn.
Thank you for the answer, but tColumn.Header contains DisplayLabel of the field (which will change with translations to other languages, so I cannot depend on it). There must be the field name, somewhere 🙂
-
Well, you can try to disable Start page and you will see... If it does not help, you can enable it again (remove the underscore). On my PCs, disabling Start page removed these annoying messages about script errors.
-
Start page? I make this change in registry after installation (add "_" before "Start"):
HKEY_CURRENT_USER\Software\Embarcadero\BDS\20.0\Known IDE Packages
$(BDS)\Bin\startpageide260.bpl = _Start Page IDE Package -
Hello,
I have a tStringGrid linked to tIBQuery. In tStringGrid.OnDrawColumnCell, I would like to change font color or style in dependence of data in that column.
Now I am able to do something like this:
procedure TZasobaForm.grZasobaDrawColumnCell(Sender: TObject; const Canvas: TCanvas; const Column: TColumn; const Bounds: TRectF; const Row: Integer; const Value: TValue; const State: TGridDrawStates); begin Canvas.Font.Size:=grZasoba.TextSettings.Font.Size; if (Column<>nil)and(Column.Index=1) then begin Canvas.Font.Style:=[tFontStyle.fsBold]; end; Canvas.Fill.Color:=TAlphaColorRec.Black; Canvas.FillText(Bounds, (Value.AsString), false, 1, [], TTextAlign.taLeading, TTextAlign.taCenter); end;
But instead of using if Column.Index=..., I would like to use something like if Column.DataField='PRICE'... How can I obtain field name for the Column? Columns can be moved on runtime, so I cannot expect that Price is always second column in the grid.
In .fmx, there is:
object grZasoba: TStringGrid Align = Client CanFocus = True ClipChildren = True Size.Width = 391.000000000000000000 Size.Height = 208.000000000000000000 Size.PlatformDefault = False TextSettings.Trimming = None StyledSettings = [Family, Style, FontColor] TabOrder = 1 RowCount = 0 Options = [ColumnResize, ColumnMove, ColLines, RowLines, RowSelect, AlwaysShowSelection, Tabs, Header, HeaderClick] DefaultDrawing = False OnDrawColumnCell = grZasobaDrawColumnCell Viewport.Width = 387.000000000000000000 Viewport.Height = 183.000000000000000000 end object BindSourceZasoba: TBindSourceDB DataSet = qZasoba ScopeMappings = <> Left = 88 Top = 240 end object BindingsList1: TBindingsList Methods = <> OutputConverters = <> Left = 20 Top = 5 object LinkGridToDataSourceBindSourceDB12: TLinkGridToDataSource Category = 'Quick Bindings' DataSource = BindSourceZasoba GridControl = grZasoba Columns = < item MemberName = 'PRICE' Width = 40 end ...
Kind regards,
Karel
-
uses Direct2D; procedure TMainForm.PaintBox1Paint(Sender: TObject); var D2Canvas: TDirect2DCanvas; begin D2Canvas:=TDirect2DCanvas.Create(PaintBox1.Canvas, PaintBox1.ClientRect); try D2Canvas.BeginDraw; try D2Canvas.Brush.Style:=bsSolid; D2Canvas.Brush.Color:=clFuchsia; D2Canvas.FillRect(PaintBox1.ClientRect); D2Canvas.Font.Size:=32; D2Canvas.Font.Color:=clBlack; D2Canvas.TextOut(100, 100, 'Delphi 25th'); finally D2Canvas.EndDraw; end; finally FreeAndNil(D2Canvas); end; end;
This is not OK?
-
2 hours ago, Steve Maughan said:Hi Vandrovnik — I'm aware of the basics of Difect2D, but how could I merge two Direct2D canvases and preserve the anti-aliasing of the text? If I'm not mistaken this isn't easy using Direct2D (but I'm far from being an expert on this).
Thanks again, Steve
Hello, as David already wrote - just render the text on the map, there is no need to render it to a bitmap and then merge bitmaps.
Do you need to print the result? Because that was a pain with Direct2D and Delphi 😕
-
-
Recently I have changed drawing to Direct2D, where transparency is not a problem.
-
Af far as I know, IDE is not HDPI aware (yet), so it will be blured...
-
10 hours ago, Turan Can said:There is nothing wrong.
Command ptr
ipconfig /flushdns
Usually when one has to change important DNS record, he wants to minimalize problems for users. Here is a description how to do it in a better way than just to change record with TTL 3 days: https://www.dnswatch.info/articles/dns-update
-
50 minutes ago, PeterPanettone said:460 chars.
And path to rtl260.bpl is included in it?
Image pointer and buffer size
in Algorithms, Data Structures and Class Design
Posted
Do you need pointer to raw image data (say RGB bytes for 24 bit/px images - ScanLine), or pointer to data which you saved to ms in your example? tMemoryStream has property Memory (pointer to its data).