Autor Beitrag
Raven280438
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 99



BeitragVerfasst: Mi 29.09.10 11:09 
Hi,

ich zeichne mit e.Graphics.DrawImage verschiedene Bilder.
Jetzt möchte ich, wenn ich mit der Maus über ein Bild fahre, dass es "aufgehellt" wird, also hab transparent.
Wie bekomm ich das am besten hin?


Gruß
Necaremus
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 203
Erhaltene Danke: 18

Win > XP, Vista, 7; Android 2.1
C# > VS '08,'10; Delphi7
BeitragVerfasst: Mi 29.09.10 11:19 
du könntest eine imagebox mit einem weißen image über deine eigene platzieren, die halt relativ hohe transparenz hat.
so würde ich das versuchen - hab es selbst noch nie gemacht, also kA ob es funktioniert.
Raven280438 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 99



BeitragVerfasst: Mi 29.09.10 12:16 
Hi,

kann man das auch ohne eine ImageBox machen, also selbst ein Bild erzeugen, das halb transparent ist und dann mit ImageDraw anzeigen?


Gruß
Necaremus
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 203
Erhaltene Danke: 18

Win > XP, Vista, 7; Android 2.1
C# > VS '08,'10; Delphi7
BeitragVerfasst: Mi 29.09.10 12:28 
transparenz erhellt ja nicht, es macht nur transparent...
was würde dir also ein transparentes bild bringen? wenn der hintergrund dunkler ist, als das bild, dann würde es sogar dunkler werden ;)
Raven280438 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 99



BeitragVerfasst: Mi 29.09.10 12:30 
Naja ich dachte, man erstellt ein weißes Bild und macht es zu 50% transparent. Dann sollte doch das darunterliegende Bild aufgehellt werden, oder lieg ich da falsch? ;)


Gruß
Greenberet
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 339
Erhaltene Danke: 20

Win 10
C# (VS 2012), C++ (VS 2012/GCC), PAWN(Notepad++), Java(NetBeans)
BeitragVerfasst: Mi 29.09.10 13:02 
Am einfachsten ist, du rechnest das Bild nach Suche in Wikipedia YUV um, bearbeitest den Y Wert so wie du die Helligkeit halt haben willst und rechnest dann alles wieder nach RGB und setzt die Werte im neuen "helleren" Bild
Raven280438 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 99



BeitragVerfasst: Mi 29.09.10 13:10 
Hi,

ok, und wie mach ich das am besten? Gibts da vorgefertigte Klassen oder muss ich selbst was schreiben?


Gruß
Greenberet
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 339
Erhaltene Danke: 20

Win 10
C# (VS 2012), C++ (VS 2012/GCC), PAWN(Notepad++), Java(NetBeans)
BeitragVerfasst: Mi 29.09.10 14:54 
Das darfst du dir selber schreiben. Wie das geht steht im Wikipedia Artikel
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4764
Erhaltene Danke: 1052

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mi 29.09.10 15:42 
Evtl. könnte die LowLevelGraphicsLibrary etwas für dich sein (habe mich selber aber auch noch nicht damit befasst).

Edit:
ausblenden C#-Quelltext
1:
new Brightness(10).Execute(bitmap);					

müßte die für dich interessante Methode sein (den Parameter 10 dann entsprechend anpassen).
Necaremus
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 203
Erhaltene Danke: 18

Win > XP, Vista, 7; Android 2.1
C# > VS '08,'10; Delphi7
BeitragVerfasst: Mi 29.09.10 16:02 
ich habe mal eine kleine frage:

bastelst du dir eigene buttons? denn dort ist es ja üblich, dass die beim hover-event aufhellen.
Raven280438 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 99



BeitragVerfasst: Mi 29.09.10 16:04 
Nein,

ich lass mir einfach mehrere Bilder nebeneinander anzeigen, und je nachdem wo die Maus drauf ist, das will ich hervorheben. ;)


Gruß
Greenberet
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 339
Erhaltene Danke: 20

Win 10
C# (VS 2012), C++ (VS 2012/GCC), PAWN(Notepad++), Java(NetBeans)
BeitragVerfasst: Mi 29.09.10 16:17 
in diesem Fall würde ich das Bild allerdings nicht aufhellen sondern die anderen Abdunkeln. Du willst ja das Bild was du hervorhebst erkennen und nicht davon geblendet werden