Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi FM keine Funktionalität bei Image Manipulation (https://www.delphipraxis.net/178276-fm-keine-funktionalitaet-bei-image-manipulation.html)

mkinzler 30. Dez 2013 16:19

AW: FM keine Funktionalität bei Image Manipulation
 
Width und Height sind vom Typ Single

Delphi-Quellcode:
Bmp := TBitmap.Create(int(Image1.width),int(Image1.Height));

Mavarik 30. Dez 2013 16:32

AW: FM keine Funktionalität bei Image Manipulation
 
Zitat:

Zitat von mkinzler (Beitrag 1241487)
Width und Height sind vom Typ Single

Delphi-Quellcode:
Bmp := TBitmap.Create(int(Image1.width),int(Image1.Height));

Stimmt... Hatte es so aus dem "Kopf" getippt...

Mache das sogar noch anders: (Zum Beispiel für einen "Label zu erzeugen")
Delphi-Quellcode:
        IMG.Bitmap := TBitmap.Create(1,1);

        Font        := TFont.Create;
        Font.Family := Arial;
        Font.Size   := (4 + (FontSize / 2)) * GlobalScale * ScreenFontScale;

        if Fett
          then Font.Style := [TFontStyle.fsBold]
          else Font.Style := [];

        IMG.Bitmap.Canvas.Font.Assign(Font);

        R.Top   := 0;
        R.Left  := 0;
        R.Bottom := 20000;
        R.Right := Width * GlobalScale;

        IMG.Bitmap.Canvas.MeasureText(R,TText,true,[],TTextAlign.taLeading,TTextAlign.taLeading);

        IMG.Bitmap.SetSize(trunc(R.Right),trunc(R.Bottom+3));

        IMG.Bitmap.Canvas.Fill.Color  := TAlphacolorRec.Black;
        IMG.Bitmap.Canvas.Fill.Kind   := TBrushKind.bkSolid;

        IMG.Bitmap.Canvas.BeginScene;

        IMG.Bitmap.Canvas.Font.Assign(Font);
        IMG.Bitmap.Clear(NotSelectedTransparent);
        IMG.Bitmap.Canvas.FillText(R,TText,true,1,[],TTextAlign.taLeading,TTextAlign.taLeading);

        IMG.Bitmap.Canvas.EndScene;

        IMG.Height := IMG.Bitmap.Height;
        IMG.Width := IMG.Bitmap.Width;

Mavarik

zeras 30. Dez 2013 16:43

AW: FM keine Funktionalität bei Image Manipulation
 
Zitat:

Zitat von mkinzler (Beitrag 1241487)
Width und Height sind vom Typ Single

Delphi-Quellcode:
Bmp := TBitmap.Create(int(Image1.width),int(Image1.Height));

Wen ich bei mir auf Die beiden Werte width und height zeige, dann bringt mir Delphi die Info, dass diese "extended" sind. Habe mal das Image mit festen Werten erzeugt und nun kommt erst einmal die Farbe "aufs Papier".

Danke für eure Tipps.

Mavarik 30. Dez 2013 17:24

AW: FM keine Funktionalität bei Image Manipulation
 
Zitat:

Zitat von zeras (Beitrag 1241493)
Wen ich bei mir auf Die beiden Werte width und height zeige, dann bringt mir Delphi die Info, dass diese "extended" sind. Habe mal das Image mit festen Werten erzeugt und nun kommt erst einmal die Farbe "aufs Papier".

Danke für eure Tipps.

Gerne! Deswegen sehe ich hier Bedarf an einer Zusammenarbeit. Siehe


Alle Zeitangaben in WEZ +1. Es ist jetzt 20:21 Uhr.
Seite 2 von 2     12   

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-2025 by Thomas Breitkreuz