Click here to Skip to main content
15,889,116 members
Home / Discussions / Graphics
   

Graphics

 
QuestionOpenGL alpha transparency Pin
XTAL2564-Jun-07 14:08
XTAL2564-Jun-07 14:08 
AnswerRe: OpenGL alpha transparency Pin
El Corazon7-Jun-07 9:31
El Corazon7-Jun-07 9:31 
GeneralRe: OpenGL alpha transparency Pin
XTAL25615-Jun-07 18:13
XTAL25615-Jun-07 18:13 
GeneralRe: OpenGL alpha transparency Pin
El Corazon17-Jun-07 18:42
El Corazon17-Jun-07 18:42 
GeneralRe: OpenGL alpha transparency Pin
XTAL25619-Jun-07 18:05
XTAL25619-Jun-07 18:05 
GeneralRe: OpenGL alpha transparency Pin
El Corazon21-Jun-07 9:30
El Corazon21-Jun-07 9:30 
GeneralRe: OpenGL alpha transparency Pin
XTAL25621-Jun-07 18:00
XTAL25621-Jun-07 18:00 
QuestionProblem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 7:47
Sepharo4-Jun-07 7:47 
I've been using CastorTiu's amazing IconLib in my application.

http://www.codeproject.com/cs/library/IconLib.asp

He has a function in the library that adds an image to an icon. It can add images of many different bit types and they all work fine except for 8bit images. When 8 bit images go through this code which reproduces a full palette the for loop iterates 256 times and this causes the program to go unresponsive for too long... It does eventually finish but only after nearly freezing the program for a few seconds. I was wondering if anyone knew of an alternative for creating a full palette that isn't so intensive on the system.


Here is the function that causes the delays with 8bit images but not 4bit [16 iterations] or 32 bit [skips loop altogether]

public static RGBQUAD[] RGBQUADFromColorArray(Bitmap bmp)<br />
{<br />
    // Some programs as Axialis have problems with a reduced palette, so lets create a full palette<br />
    int bits = Tools.BitsFromPixelFormat(bmp.PixelFormat);<br />
    RGBQUAD[] rgbArray = new RGBQUAD[bits <= 8 ? (1 << bits) : 0];<br />
    for(int i=0; i < bmp.Palette.Entries.Length; i++)<br />
    {<br />
        rgbArray[i].rgbRed  = bmp.Palette.Entries[i].R;<br />
        rgbArray[i].rgbGreen= bmp.Palette.Entries[i].G;<br />
        rgbArray[i].rgbBlue = bmp.Palette.Entries[i].B;<br />
    }<br />
    return rgbArray;<br />
}

AnswerRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 8:05
Mark Salsbery4-Jun-07 8:05 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 8:26
Sepharo4-Jun-07 8:26 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 8:37
Mark Salsbery4-Jun-07 8:37 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 8:41
Sepharo4-Jun-07 8:41 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 8:59
Sepharo4-Jun-07 8:59 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:22
Mark Salsbery4-Jun-07 9:22 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:16
Mark Salsbery4-Jun-07 9:16 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 9:23
Sepharo4-Jun-07 9:23 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:28
Mark Salsbery4-Jun-07 9:28 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 9:40
Sepharo4-Jun-07 9:40 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:44
Mark Salsbery4-Jun-07 9:44 
GeneralRe: Problem extracting full palette from 8bit image Pin
Mark Salsbery4-Jun-07 9:36
Mark Salsbery4-Jun-07 9:36 
GeneralRe: Problem extracting full palette from 8bit image Pin
Sepharo4-Jun-07 9:42
Sepharo4-Jun-07 9:42 
QuestionWinamp like credits? Pin
Stevie4-Jun-07 1:05
Stevie4-Jun-07 1:05 
QuestionHow to create a dynamic array of direct draw surfaces [modified] Pin
GTaylor552-Jun-07 15:50
GTaylor552-Jun-07 15:50 
AnswerRe: A Workaround solution Pin
GTaylor554-Jun-07 0:33
GTaylor554-Jun-07 0:33 
GeneralRe: A Workaround solution Pin
XTAL2564-Jun-07 2:47
XTAL2564-Jun-07 2:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.