更新
这是控制屏幕亮度的Apple。以下是最初的问题。
通过使用谷歌,我发现我可以通过以下方法禁用应用程序中的iPhone:
application.idleTimerDisabled = YES;
代码看起来如下:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after application launch
// This disables the autosleep I added this
我已经看到了很多关于检测暗模式的问题,比如堆栈溢出上的this one,我访问了许多媒体博客,比如How to know when you’re using dark mode programmatically和DayNight — Adding a dark theme to your app,在所有这些博客中,他们都执行了这样的检查: fun isNightModeEnabled(context: Context): Boolean =
context.resources.configuration.uiMode.and(UI_MODE_NIGHT_MASK) ==
我正在读一个24位的位图:
var P: PByteArray;
...
for y:=0 to Bmp.Height-1 do begin
P := Bmp.ScanLine[y];
for x:=0 to Bmp.Width-1 do begin
R := P[3*x+2];
G := P[3*x+1];
B := P[3*x ];
现在我用BGR交换RGB:
P[3*x+2] := B;
P[3*x+1] := G;
P[3*x ] := R;
所以,如果我的图像上有红色的东西,它现在是蓝色的,而