Willkommen ~Gast!
Registrieren || Einloggen || Hilfe/FAQ || Staff
Probleme mit der Registrierung im Forum? Melde dich unter registerEin Bild.
Autor Beitrag
000
17.08.2002, 23:01
Diablo_bth



aslo da mir M$Dev 6.0 mit jpeg so einige Problemchen hat (mag die nicht wirklich als Recource) habe ich mmir gedacht lade ich doch einfach das Teil als RGB oder RGBA und lade es ins Fenster. Aber wie zeichne ich am einfachsten (und ohne OpenGL) Pixel im RGB o. RGBA Format in ein Fenster? Brauche ich dafür ein Device-Context oder ähnliches?

--

zum Seitenanfang zum Seitenende Profil || Suche
001
17.08.2002, 23:43
theDon



hm ja...guck dir mal genau an was bitblt() macht (ka wies genau hiess kann auch bit_blt() gewesen sein)

--

\o tanz den naziprau! o/

And more than ever, I hope to never fall,
Where enough is not the same it was before

zum Seitenanfang zum Seitenende Profil || Suche
002
17.08.2002, 23:45
mani



Zitat:
This function sets the pixel at the specified coordinates to the specified color.

COLORREF SetPixel(
HDC hdc,
int X,
int Y,
COLORREF crColor
);
Parameters

hdc
[in] Handle to the device context.
X
[in] Specifies the x-coordinate, in logical units, of the point to be set.
Y
[in] Specifies the y-coordinate, in logical units, of the point to be set.
crColor
[in] Specifies the color to be used to paint the point.
Return Values

The RGB value that the function sets the pixel to indicates success. This value may differ from the color specified by crColor; that happens when an exact match for the specified color cannot be found. –1 indicates failure. To get extended error information, call GetLastError.


Quellcode:
HDC hdc = GetDC(hwnd);
{
    SetPixel(hdc, 5, 5, RGB(255,0,0));
} ReleaseDC(hdc, hwnd);

--


Dieser Beitrag wurde am 17.08.2002 um 23:47 von mani bearbeitet.
zum Seitenanfang zum Seitenende Profil || Suche
003
18.08.2002, 00:05
theDon



hm...setpixel() ist laaangsam...bitblt ist schneller

--

\o tanz den naziprau! o/

And more than ever, I hope to never fall,
Where enough is not the same it was before

zum Seitenanfang zum Seitenende Profil || Suche
004
18.08.2002, 02:09
Tron



bitblt is fuer kopieren zwischen DCs.
was du brauchst ist SetDIBitsToDevice, das kopiert pixel auf einen DC, das genaue format der pixel wird durch einen bitmapheader festgelegt.

--

'KEINE PANIK' - aus der Triologie in fuenf Baenden von Douglas Adams

'FÜR DEINN FERD' - aus 'Gevatter Tod' von Terry Pratchett

zum Seitenanfang zum Seitenende Profil || Suche
005
18.08.2002, 02:49
Leviathan



du musst aber erst von RGB in COLORREF konvertieren.

RGB ist eine struktur, die einzelfarben bekommst du in den member-variablen (ich weiss jetzt nicht genau, wie die heissen, musst du mal nachlesen). COLORREF ist das gleiche wie ein long, aber es gibt makros, die die einzelfarbwerte setzen (afaik SetRValue, SetGValue und SetBValue).

--

Entities: HL | HL²
Kompilierfehler
r_speeds | mehr über r_speeds

zum Seitenanfang zum Seitenende Profil || Suche
006
18.08.2002, 14:35
TheTinySteini



... er muss sowieso erstmal von JPG nach BMP =)

--

TheTinySteini
Coder Poke646
"Don't Panic" - Hitchhiker's Guide to the Galaxy

zum Seitenanfang zum Seitenende Profil || Suche
007
18.08.2002, 17:40
apfelkorn



na, tiny, an sich muss ers nur pixel by pixel auslesen (bzw. zur Laufzeit dekodieren)

--

zum Seitenanfang zum Seitenende Profil || Suche