Grab Color from a Pixel

Irrlicht.Net is no longer developed or supported, Irrlicht.Net Cross Platform is a much more complete wrapper. Please ask your C# related questions on their forums first.
Locked
BlueFrank
Posts: 2
Joined: Tue Aug 01, 2006 7:49 pm

Grab Color from a Pixel

Post by BlueFrank »

Sorry for my bad English. I want programm a Isometric Game and at moment i implement a Clas for Tile-Managment.

I load a Texture with:

Irrlicht.Video.ITexture back = driver.GetTexture(strFile);

then i want to grab the Color from a Pixel in this Tile (because i want to make
a Tileset and i want determine where the Borders are from every Tile in the Set.)

I need a Function like

Irrlicht.Video.Color clrAnchor = new Color();
clrAnchor = back.GetColorFromPixel(x,y); :cry:

Is something like that possible?? Does anyone know a workaround
for this Problem??


[/url]
shurijo
Posts: 148
Joined: Sat Feb 21, 2004 3:04 am

Post by shurijo »

This is in C#, but if you are using VB.NET just make appropriate synatx changes.

Code: Select all


System.Drawing.Bitmap myBitMap = new System.Drawing.Bitmap(myImageFileName);

System.Drawing.Color myPixelColor = myBitMap.GetPixel(x, y);

Irrlicht.Video.Color myIrrColor = new Irrlicht.Video.Color(myPixelColor.A, myPixelColor.R, myPixelColor.G, myPixelColor.B);

myImageFileName is the path to any image format (it doesn't need to be a BMP, it can be JPG, etc.).
BlueFrank
Posts: 2
Joined: Tue Aug 01, 2006 7:49 pm

Post by BlueFrank »

You are a Master shurijo!! Many Thanks. The Combination with GDI
Functions and Irrlicht works perfect.
[/code]
Locked