![]() |
Bitmap2Cursor Funktionsfehler unter Win95/98/ME
Erstelle mit dieser Funktion aus zwei 24x24 Bitmap's (in 16 Farben) einen "Symbol" Mauszeiger Cursor.
Ein Bild ist immer gleich (Pfeil) - das andere wechselt (Symbol)- der Hintergrund der gelöscht werden soll ist bei allen Bildern immer gleich, so das geht auch alles prima - unter Windows 2000/NT/XP/Vista aber... unter Windows 95/98/ME ist der so erzeugte Mauszeiger bzw. genau "die Hintergrundfarbe" als "dunkelgrau" sichtbar? Hmmmm... jemand eine Idee hierzu?
Delphi-Quellcode:
Rest nur zur weiteren Info!
// var XPonPC: boolean;
// wird z.Z. vorher geprüft ob XP on System function Bitmap2Cursor(Bitmap: TBitmap): HCursor; var IconInfo: TIconInfo; begin try if (XPonPC) then begin BitBlt(cursorbild32.Canvas.Handle,8,8,32,32,bitmap.Canvas.Handle,0,0,SRCCOPY); IconInfo.fIcon := False; IconInfo.hbmColor := cursorbild32.Handle; IconInfo.hbmMask := bildmask32.Handle end else begin cursorbild32.Canvas.Draw(8,8,Bitmap); IconInfo.fIcon := False; IconInfo.hbmColor := cursorbild32.Handle; IconInfo.hbmMask := cursorbild32.MaskHandle; end; IconInfo.xHotspot := 1; IconInfo.yHotspot := 1; Result := CreateIconIndirect(IconInfo); except begin Result := Screen.Cursors[crHandPoint]; end; end; end;
Delphi-Quellcode:
procedure HighSpeedChangeColor(ID: Word; Org: TBitmap; NeueFarbe: TColor);
var links,oben,wert: Word; begin case neuefarbe of clyellow: begin BitBlt(org.Canvas.Handle,0,0,Org.Width,Org.Height,gbbildgelb.Canvas.Handle,links,oben,SRCCOPY); end; //ect. ect. end;
Delphi-Quellcode:
*gesamter Quelltext einsehbar auf meiner Homepage
procedure Maus_Cursor_setzen;
var zeichenbild: TBitmap; begin zeichenbild := TBitmap.Create; try zeichenbild.PixelFormat := pf4bit; zeichenbild.Canvas.Brush.Style := bsSolid; zeichenbild.Canvas.Brush.Color := FormGB.PaintBoxGB.Color; zeichenbild.Canvas.Pen.Style := psSolid; zeichenbild.Canvas.Pen.Color := FormGB.PaintBoxGB.Color; zeichenbild.TransparentMode := tmfixed; zeichenbild.TransparentColor := FormGB.PaintBoxGB.Color; zeichenbild.Width := 24; zeichenbild.Height := 24; zeichenbild.Dormant; zeichenbild.FreeImage; zeichenbild.IgnorePalette := true; HighSpeedChangeColor(gbzielbild,zeichenbild,clyellow); // ect. ect. try // In den Cursor Screen.Cursors[9999] := Bitmap2Cursor(zeichenbild); // sofort anzeigen FormGB.PaintBoxGB.Cursor := 9999; finally zeichenbild.free; end; end; mfg |
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:15 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-2025 by Thomas Breitkreuz