Advertisement

Pictures in windows, DCs etc.

Started by June 05, 2000 04:37 PM
-1 comments, last by MadCowan 24 years, 6 months ago
I have a program (originally written in Java) and since it''s so bloody slow (it draws fractals) I figured I would write it in C++. The way the program writes pixels to the screen is to create a great big array of 8-bit integers, formatted in RGB format. So if the fractal was a 2x2 image (tiny I know -- but this is just an example) the array would be 96-bits long (12 chars). Now I''ve tried every bloody command in the whole of the MSDN documentation to no avail. I can''t believe that there''s not some straightforward way of displaying a 24-bit RGB format array of bitmap information onto a device contect. All the examples I''ve seen in the documentation that do anything like this are hideous -- convert to a memory context, create a dib, format the dib, write to a bmp convert to new context create another dib for fun, add it to the...well you get the idea. Is there not some nice way!? Or is windows the load of crap that I''ve always believed it to be? Actually, I have managed to get it to work -- but it is necessary for me to use the same bit-depth as the display in my memory-representation of the image. If the bit-depth isn''t the same, then nothing appears. I''m seriously considering using Glide or OpenGL where I just have to say DrawPoint(x,y,r,g,b) or something! Help appreciated!

This topic is closed to new replies.

Advertisement