AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Is this correct?

Ein Thema von WojTec · begonnen am 22. Mai 2011 · letzter Beitrag vom 23. Mai 2011
Antwort Antwort
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

Is this correct?

  Alt 22. Mai 2011, 18:32
Get RGB from TColor:
Delphi-Quellcode:
R := AColor and $FF;
G := (AColor shr $8) and $FF;
B := (AColor shr $10) and $FF;
Set TColor from RGB:
Result := (B shl $10) or (G shl $8) or R; Is it ok?
  Mit Zitat antworten Zitat
Benutzerbild von implementation
implementation

Registriert seit: 5. Mai 2008
940 Beiträge
 
FreePascal / Lazarus
 
#2

AW: Is this correct?

  Alt 22. Mai 2011, 18:43
Yes, that should be right
Code:
$00 FF FF FF
 |  |  |  |
 A  B  G  R
where Alpha is ignored by the GDI.
  Mit Zitat antworten Zitat
Namenloser

Registriert seit: 7. Jun 2006
Ort: Karlsruhe
3.724 Beiträge
 
FreePascal / Lazarus
 
#3

AW: Is this correct?

  Alt 22. Mai 2011, 18:49
As implementation already said, it should work, but why don’t you just try it out? On a side note, I find using hexadecimal numbers for bitshifting a little confusing, but maybe that’s just me.
where Alpha is ignored by the GDI.
Actually, it isn’t ignored, but it represents a palette entry instead of an alpha value.
  Mit Zitat antworten Zitat
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.542 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: Is this correct?

  Alt 23. Mai 2011, 07:25
By the way: Delphi-Referenz durchsuchenColorToRGB, MSDN-Library durchsuchenRGB, you do not need to implement these functions yourself.
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:58 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz