Click here to Skip to main content
15,922,512 members
Home / Discussions / C#
   

C#

 
GeneralRe: create xml for collection class Pin
James T. Johnson28-May-02 8:33
James T. Johnson28-May-02 8:33 
GeneralRe: create xml for collection class Pin
sharon28-May-02 19:15
sharon28-May-02 19:15 
QuestionWhat the ¤#& is the use of Interfaces!!! Pin
Rickard Andersson2028-May-02 1:28
Rickard Andersson2028-May-02 1:28 
AnswerRe: What the ¤#& is the use of Interfaces!!! Pin
Nish Nishant28-May-02 4:02
sitebuilderNish Nishant28-May-02 4:02 
AnswerRe: What the ¤#& is the use of Interfaces!!! Pin
James T. Johnson28-May-02 8:27
James T. Johnson28-May-02 8:27 
GeneralRe: What the ¤#& is the use of Interfaces!!! Pin
Nish Nishant28-May-02 14:47
sitebuilderNish Nishant28-May-02 14:47 
GeneralRe: What the ¤#& is the use of Interfaces!!! Pin
James T. Johnson28-May-02 14:53
James T. Johnson28-May-02 14:53 
GeneralScaling a transparent 256 colors gif or png with GDI+ Pin
27-May-02 22:33
suss27-May-02 22:33 
Hello all,

I am trying to create thumnails of web images stored in a database(gif, jpeg and png)
I ran into problems with palettes and transparency.
Does anyone have an idea on how to scale an 8 bpp (or other indexed color depth), gif or png, retaining the palette and transparency, using GDI+ and the .NET framework.

I tried the Graphics.DrawImage method and the Bitmap.GetThumbImage method, but they end up loosing the palette and the transparency. (They work fine for JPEG)
Any Graphics image drawing does not work on indexed colors images.

One way to do it would be to access the BitmapData through unsafe code with the LockBitmap method for the source and destination and apply a linear transformation to fill the palette indexes of the destination and copy the palette from the source to the destination. (As in Christian Graus's articles)

Another way would be to make the destination a 36 bits ARGB image, copy/scale the source with a bicubic interpolation and then reduce the color of the destination image using the palette of the source, letting the encoder use the alpha channel info to set the transparency.

None of that seems straight forward to me.

Thanks if anyone can help.

Confused | :confused:
GeneralRe: Scaling a transparent 256 colors gif or png with GDI+ Pin
James T. Johnson28-May-02 8:29
James T. Johnson28-May-02 8:29 
GeneralRe: Scaling a transparent 256 colors gif or png with GDI+ Pin
Todd Smith30-May-02 7:11
Todd Smith30-May-02 7:11 
QuestionHow can I use the libraries on runtime? Pin
Vu Truong27-May-02 22:10
Vu Truong27-May-02 22:10 
AnswerRe: How can I use the libraries on runtime? Pin
Nish Nishant28-May-02 1:07
sitebuilderNish Nishant28-May-02 1:07 
GeneralConverting Windows Forms to Web Forms using C# Pin
27-May-02 18:22
suss27-May-02 18:22 
GeneralVersioning Pin
27-May-02 18:05
suss27-May-02 18:05 
GeneralRe: Versioning Pin
James T. Johnson28-May-02 8:36
James T. Johnson28-May-02 8:36 
GeneralRe: Versioning Pin
29-May-02 9:55
suss29-May-02 9:55 
GeneralCalling default mail client...... Pin
Pranoti27-May-02 7:35
Pranoti27-May-02 7:35 
GeneralRe: Calling default mail client...... Pin
Rocky Moore27-May-02 8:46
Rocky Moore27-May-02 8:46 
GeneralUsing OCX controls in .NET Pin
JerzyPeter27-May-02 5:50
JerzyPeter27-May-02 5:50 
GeneralTextBox text color Pin
Paddy26-May-02 19:30
Paddy26-May-02 19:30 
GeneralRe: TextBox text color Pin
Nick Parker26-May-02 19:33
protectorNick Parker26-May-02 19:33 
GeneralRe: TextBox text color Pin
Paddy26-May-02 19:47
Paddy26-May-02 19:47 
GeneralRe: TextBox text color Pin
Nick Parker26-May-02 20:00
protectorNick Parker26-May-02 20:00 
GeneralRe: TextBox text color Pin
Paddy26-May-02 20:44
Paddy26-May-02 20:44 
GeneralRe: TextBox text color Pin
Rocky Moore26-May-02 22:25
Rocky Moore26-May-02 22:25 

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.