Re: [lazarus] scanline example didn't work after update to svn 12247

2007-10-04 Thread Valdas Jankūnas

Mattias Gaertner rašė:

The LCL TBitmap has no ScanLine property, because under Delphi its
only purpose is fast direct access and this is not possible under all
LCL platforms.
But there is an alternative, which can be used in most cases.
See lazarus/examples/scanline/.


In file unit.pas of that example is written:

  // fill line with gray
  for i:=0 to (ImgWidth*4)-1 do
PByte(LineStart)[i]:=0; // set red, green and blue to 128 (i.e. gray)

I think in comments and in other places should be word black not 
gray or value should be PByte...:=128 not 0...


--
  Valdas Jankūnas

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] scanline example didn't work after update to svn 12247

2007-10-04 Thread Mattias Gaertner
On Thu, 04 Oct 2007 12:12:29 +0300
Valdas Jankūnas [EMAIL PROTECTED] wrote:

 Mattias Gaertner rašė:
  The LCL TBitmap has no ScanLine property, because under Delphi its
  only purpose is fast direct access and this is not possible under
  all LCL platforms.
  But there is an alternative, which can be used in most cases.
  See lazarus/examples/scanline/.
 
 In file unit.pas of that example is written:
 
// fill line with gray
for i:=0 to (ImgWidth*4)-1 do
  PByte(LineStart)[i]:=0; // set red, green and blue to 128 (i.e.
 gray)
 
 I think in comments and in other places should be word black not 
 gray or value should be PByte...:=128 not 0...

Thanks for the hint.  Fixed.


Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] scanline example didn't work after update to svn 12247

2007-10-03 Thread Dominique Louis

Hi Mattias,
  which build of Lazarus is this available in? Because on the version I 
have, Tbitmaps don't have the scanline property.


Dominique.

Mattias Gaertner wrote:

On Tue, 02 Oct 2007 22:32:21 +0100
Dominique Louis [EMAIL PROTECTED] wrote:


Will this Scanline code also work on Mac OS X?


intel/32bit: of course.
powerpc, intel/64bit: sometimes.
It depends, what tricks your code use. The only guaranteed platform
independent way are the functions of TCanvas.

Mattias



Dominique.

12 12 wrote:
It means, the function does not work with formats which lines can 

start

in a middle of a byte (e.g. at the third bit).
The Delphi ScanLine function has the same limit.

I didn't know about such formats!
Which formats can start in a middle of a byte?


--






_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] scanline example didn't work after update to svn 12247

2007-10-02 Thread Dominique Louis

Will this Scanline code also work on Mac OS X?

Dominique.

12 12 wrote:
It means, the function does not work with formats which lines can 

start

in a middle of a byte (e.g. at the third bit).
The Delphi ScanLine function has the same limit.


I didn't know about such formats!
Which formats can start in a middle of a byte?


--
12 12 aka skywriter



_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] scanline example didn't work after update to svn 12247

2007-10-02 Thread Mattias Gaertner
On Tue, 02 Oct 2007 22:32:21 +0100
Dominique Louis [EMAIL PROTECTED] wrote:

 Will this Scanline code also work on Mac OS X?

intel/32bit: of course.
powerpc, intel/64bit: sometimes.
It depends, what tricks your code use. The only guaranteed platform
independent way are the functions of TCanvas.

Mattias


 Dominique.
 
 12 12 wrote:
  It means, the function does not work with formats which lines can 
  start
  in a middle of a byte (e.g. at the third bit).
  The Delphi ScanLine function has the same limit.
  
  I didn't know about such formats!
  Which formats can start in a middle of a byte?
  
  
  -- 
  12 12 aka skywriter
 
 
 _
  To unsubscribe: mail [EMAIL PROTECTED] with
 unsubscribe as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] scanline example didn't work after update to svn 12247

2007-10-01 Thread Mattias Gaertner
On Sun, 30 Sep 2007 08:54:14 +0400
12 12 [EMAIL PROTECTED] wrote:

 Subj. It tells:
 
 Unit1.pas(80,17) Error: identifier idents no member 
 Set_BPP32_B8G8R8_A1_BIO_TTB
 Unit1.pas(80,44) Error: Illegal expression
 Unit1.pas(80,44) Fatal: Syntax error, ; expected but ( found
 
 This function is undocumented in help so it is not obvious how to 
 replaced it.

Updated and fixed.


 And what means this line in intfgraphics.pas:
 
 function  GetDataLineStart(y: integer): Pointer;// similar to Delphi 
 TBitmap.ScanLine. Only works with byte aligned lines.
 What means Only works with byte aligned lines ? How it differs from 
 Delphi's one?

It means, the function does not work with formats which lines can start
in a middle of a byte (e.g. at the third bit).
The Delphi ScanLine function has the same limit.


Mattias

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] scanline example didn't work after update to svn 12247

2007-10-01 Thread 12 12
It means, the function does not work with formats which lines can 

start

in a middle of a byte (e.g. at the third bit).
The Delphi ScanLine function has the same limit.


I didn't know about such formats!
Which formats can start in a middle of a byte?


--
12 12 aka skywriter

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives