Click here to Skip to main content
15,905,912 members
Home / Discussions / C#
   

C#

 
GeneralA managed DirectDraw / DirectX question Pin
yoaz19-Apr-04 21:32
yoaz19-Apr-04 21:32 
GeneralRe: A managed DirectDraw / DirectX question Pin
Jeremy Kimball20-Apr-04 6:42
Jeremy Kimball20-Apr-04 6:42 
GeneralRe: A managed DirectDraw / DirectX question Pin
yoaz20-Apr-04 8:15
yoaz20-Apr-04 8:15 
Questioncan i get a 256 colors bitmap from DC directly ? Pin
fu019-Apr-04 21:04
fu019-Apr-04 21:04 
AnswerRe: can i get a 256 colors bitmap from DC directly ? Pin
Heath Stewart20-Apr-04 4:47
protectorHeath Stewart20-Apr-04 4:47 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
yoaz20-Apr-04 21:24
yoaz20-Apr-04 21:24 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
Heath Stewart21-Apr-04 3:09
protectorHeath Stewart21-Apr-04 3:09 
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
yoaz21-Apr-04 5:26
yoaz21-Apr-04 5:26 
cool. this works, something like:
<br />
public Bitmap ConvertTo256Bmp(Bitmap source_bmp)<br />
{<br />
	if (source_bmp == null)<br />
        return null;<br />
	System.IO.Stream bmpStream = new System.IO.MemoryStream();<br />
	Bitmap dest_bmp = null; <br />
	try<br />
	{<br />
		source_bmp.Save(bmpStream,<br />
			System.Drawing.Imaging.ImageFormat.Gif);<br />
		dest_bmp = new Bitmap(bmpStream);<br />
	}<br />
	catch(Exception e)<br />
	{<br />
		Console.WriteLine(e.Message);<br />
		return null;<br />
	}<br />
	return dest_bmp;<br />
}<br />


this returns a bmp with Format8bppIndexed pixel format.
only thing is, the resulting bmp, when written to disk, is much larger than the original. But that's somebody else problem ? Wink | ;)
GeneralRe: can i get a 256 colors bitmap from DC directly ? Pin
fu024-Apr-04 15:38
fu024-Apr-04 15:38 
Generalhelp convert a line of code Pin
User 96257819-Apr-04 19:41
User 96257819-Apr-04 19:41 
GeneralRe: help convert a line of code Pin
Mazdak19-Apr-04 19:54
Mazdak19-Apr-04 19:54 
GeneralRe: help convert a line of code Pin
Roman Rodov20-Apr-04 2:54
Roman Rodov20-Apr-04 2:54 
GeneralRe: help convert a line of code Pin
User 96257820-Apr-04 9:53
User 96257820-Apr-04 9:53 
GeneralRe: help convert a line of code Pin
Roman Rodov20-Apr-04 14:52
Roman Rodov20-Apr-04 14:52 
GeneralRe: help convert a line of code Pin
User 96257820-Apr-04 15:38
User 96257820-Apr-04 15:38 
GeneralWebconfig question Pin
dabuskol19-Apr-04 19:17
dabuskol19-Apr-04 19:17 
GeneralRe: Webconfig question Pin
Mazdak19-Apr-04 19:57
Mazdak19-Apr-04 19:57 
GeneralRe: Webconfig question Pin
dabuskol19-Apr-04 21:40
dabuskol19-Apr-04 21:40 
GeneralRe: Webconfig question Pin
Mazdak19-Apr-04 21:55
Mazdak19-Apr-04 21:55 
GeneralRe: Webconfig question Pin
Heath Stewart20-Apr-04 5:09
protectorHeath Stewart20-Apr-04 5:09 
Questionshowing dialog with topLevel ? Pin
azusakt19-Apr-04 17:45
azusakt19-Apr-04 17:45 
AnswerRe: showing dialog with topLevel ? Pin
LongRange.Shooter20-Apr-04 2:35
LongRange.Shooter20-Apr-04 2:35 
AnswerRe: showing dialog with topLevel ? Pin
Heath Stewart20-Apr-04 5:05
protectorHeath Stewart20-Apr-04 5:05 
GeneralRe: showing dialog with topLevel ? Pin
azusakt20-Apr-04 16:31
azusakt20-Apr-04 16:31 
GeneralRe: showing dialog with topLevel ? Pin
Heath Stewart21-Apr-04 3:04
protectorHeath Stewart21-Apr-04 3:04 

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.