View Issue Details

IDProjectCategoryView StatusLast Update
0035793LazarusFCLpublic2019-07-21 13:51
ReporterKa-Chun ChengAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0035793: Delphi API BytesPerScanline is undefined in FCL
Descriptionhttp://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/delphivclwin32/Graphics_BytesPerScanline@Longint@Longint@Longint.html#4465736372697074696F6E
TagsNo tags attached.
Fixed in Revision
LazTarget
Widgetset
Attached Files

Activities

Marco van de Voort

2019-07-04 19:54

manager   ~0117063

Ouch, it is a global function, not a tbitmap property as I had expected. The exact size could be canvas etc specific.

This will be very hard to implement.

Michael Van Canneyt

2019-07-04 21:11

administrator   ~0117064

This is a lazarus function, it can only be implemented when a GUI is present.

It has no meaning in a GUI-less environment. So I moved the issue to Lazarus

Ka-Chun Cheng

2019-07-21 12:55

reporter   ~0117334

I have checked with the delphi implementation and this function is actually a helper function to do the calculation. it doesn't read anything other than the input parameters. so it is actually platform independent and it works without GUI.
but I wonder how much can we "reference" delphi? it's just 3 line of bit arithmetic. Can I post the delphi code here?

here is my unoptimized implementation without bit arithmetic

function myBytesPerScanline(PixelsPerScanline, BitsPerPixel, Alignment: Longint): Longint;
begin
  Result:= PixelsPerScanline * BitsPerPixel;
  if frac(Result / Alignment)<>0 then
    Result:=trunc(((int(Result / Alignment) + 1 ) * Alignment) /8)
  else
    Result:=Result div 8;
end;

Bart Broersma

2019-07-21 13:51

developer   ~0117335

> Can I post the delphi code here?
NO!

Issue History

Date Modified Username Field Change
2019-07-04 19:29 Ka-Chun Cheng New Issue
2019-07-04 19:54 Marco van de Voort Note Added: 0117063
2019-07-04 21:10 Michael Van Canneyt Project FPC => Lazarus
2019-07-04 21:11 Michael Van Canneyt Note Added: 0117064
2019-07-21 12:55 Ka-Chun Cheng Note Added: 0117334
2019-07-21 13:51 Bart Broersma Note Added: 0117335