Autor Beitrag
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Di 23.03.10 16:01 
Also entweder ich hab was falsch eingestellt oder kein Mensch steuert Open Office via OLE von Delphi aus. Vielleicht steh ich aber auch einfach auf dem Schlauch.


Also ich habe nun folgende Funktion

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TOLE_OpenOffice.CharColor(sheet,ro,ru,sl,sr:Integer;color:TColor);
var ra : Variant;
    r,g,b : Byte;
begin
  r := GetRValue(color);
  g := GetGValue(color);
  b := GetBValue(color);
  ra := Document.sheets.getbyindex(sheet).getCellRangebyName(CellIndexToCellName(sl,ro)+':'+CellIndexToCellName(sr,ru));
  ra.CharColor := RGB(b,g,r);
end;


Diese setzt mir die Schriftfarbe einer Zelle. Verwunderlich finde ich folgende Zeile:

ausblenden Delphi-Quelltext
1:
  ra.CharColor := RGB(b,g,r);					


denn wie man sieht, muss ich Rot und Blau vertauscht übergeben, damit mir Calc die Farbe richtig ausgibt. Aufgefallen war mir das als ich clNavy übergab und die Zelle Rot wurde.

Am seltsamsten finde ich nun allerdings, dass man im Internet dazu praktisch nix findet, das muss doch auffallen :( Also scheints ja doch eher an einer Einstellung bei mir zu liegen? Oder kann das jemand nachvollziehen?

_________________
mfg. Joel
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Di 23.03.10 16:17 
Liegt vermutlich daran, dass eine Zahl übergeben werden soll, wobei OpenOffice wie der Rest der Welt das Modell RGB und Delphi BGR benutzt. Also vertauscht eher Delphi rot und blau. Z. B. hat dann clRed den Code $0000ff.

Beispiel: clRed:
r = 255
g = 0
b = 0

rgb (b, g, r) = $ff0000 -> rot in RGB, aber blau in Delphi

ist also schon richtig so.
JoelH Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Di 23.03.10 16:20 
argl,

darauf muss man auch erstmal kommen :(

_________________
mfg. Joel
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Di 23.03.10 16:26 
Ist mir auch erst aufgefallen, als ich mir mal eine Farbpalette programmiert habe. HTML erwartet da ja wie OpenOffice einen RGB-Code.