![]() |
Bildverarbeitung unter FMX und dann FMLinux ....
wie muss ich diese Funktion überarbeiten, damit die unter FMX und dann später auch unter FMLinux funktioniert ?
Was wird aus Bit.ScanLine am besten?
Delphi-Quellcode:
procedure SingleChannelImage(
Bit : TBitMap; c : integer ); type PixArray = Array [ 1 .. 3 ] of Byte; var p : ^PixArray; h, w : integer; begin Bit.PixelFormat := pf24bit; For h := 0 to Bit.height - 1 do begin p := Bit.Scanline[ h ]; For w := 0 to Bit.width - 1 do begin case c of 1 : begin { B-Channel } p^[ 2 ] := 0; p^[ 3 ] := 0; end; 2 : begin { G-Channel } p^[ 1 ] := 0; p^[ 3 ] := 0; end; 3 : begin { R-Channel } p^[ 2 ] := 0; p^[ 1 ] := 0; end; else end; inc( p ); end; end; end; |
AW: Bildverarbeitung unter FMX und dann FMLinux ....
Schaue mal das hier mit den Beispielen an:
![]() Unter FMX laufen die Zugriffe auf dieser Ebene über die Map- und Unmap-Methoden und dem TBitmapData-Record. |
AW: Bildverarbeitung unter FMX und dann FMLinux ....
kann ich ein Full code sample bekommen, speziell was muss man beachten wenn man FXM dann auch unter Linux verwenden will
|
AW: Bildverarbeitung unter FMX und dann FMLinux ....
mit hilfe div. weiterer Post jetzt endlich am Ziel :)
Delphi-Quellcode:
procedure TForm2.SingleChannelImage(
Bit : TBitmap; c : integer ); var bitdata1 : TBitmapData; i : integer; j : integer; Color : TAlphaColor; begin if ( Bit.Map( TMapAccess.maReadWrite, bitdata1 ) ) then try for i := 0 to Bit.width - 1 do for j := 0 to Bit.height - 1 do begin begin Color := PixelToAlphaColor( @PAlphaColorArray( bitdata1.Data ) [ j * ( bitdata1.Pitch div PixelFormatBytes[ Bit.PixelFormat ] ) + 1 * i ], Bit.PixelFormat ); case c of 1 : begin TAlphaColorRec( Color ).B := 0; TAlphaColorRec( Color ).G := 0; end; 2 : begin TAlphaColorRec( Color ).R := 0; TAlphaColorRec( Color ).G := 0; end; 3 : begin TAlphaColorRec( Color ).B := 0; TAlphaColorRec( Color ).R := 0; end; end; AlphaColorToPixel( Color, @PAlphaColorArray( bitdata1.Data ) [ j * ( bitdata1.Pitch div PixelFormatBytes[ Bit.PixelFormat ] ) + 1 * i ], Bit.PixelFormat ); end; end; finally Bit.Unmap( bitdata1 ); end; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:11 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz