|
My first guess would be the SetFromCOLORREF method. Try passing in a ARGB defined color, and also try using one of the other c'tors. I have a feeling that internally the color is screwed up before your call to get the bitmap.
Can you see the internal members of the color object in the debugger and verify that it is set up correctly?
|
|
|
|
|
In my original post I checked the Color object at the point labeled "b:" just before the call to GetHBITMAP() and as far as I can tell by looking in the debugger the values are set properly. It does not change after the call to GetHBITMAP() yet the colour in the final bitmap is always wrong.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
strange. Out of curiosty, try grabbing a few pixels from the bitmap, just on the offchance it's being corrupted while being sent to your ImageViewer ( highly unlikely I know ). Other from that I can't think of anything.
|
|
|
|
|
Is it possbile to select a DIB in a window DC and use
normal drawing functions like Rectangle, Ellipse ..
How?
Balu Chettri
|
|
|
|
|
|
Hey Jeremy LTNS
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
Howdy howdy.
I think I found my new home on the Internet. If I end up getting into flame wars over something like OpenGL, then I must say there's no hope for me.
|
|
|
|
|
Well it's good to see you back here. Didn't know you personally but I always enjoyed,
respected, and learned something from your posts in the past.
Cheers!
Mark
mental note - start opengl flame war in the future, just for fun
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
Mark Salsbery wrote: Didn't know you personally but I always enjoyed, respected, and learned something from your posts in the past.
Oh man, where did I go wrong?
Just kidding, thanks for the kind words.
|
|
|
|
|
Hi all, i have written a program using system timer, i configures system timer using outportb(portAdd, byte) for achiveing 1msec interval. i was trying to update on filled rectangle(moving) evry 20msec. sometimes if shows flikkering effect. can i solve this problem. can i synchronise rectangle plotting with monitor updation(vertical sync), HOW?
shri
|
|
|
|
|
The drawing operations usually can't keep up with the display when this happens. So, if you have the flickering issues you either need to A: slow down the animation or B: use double buffering by drawing to an off/memory buffer and the blitting that to the display so the delay isn't noticeable.
|
|
|
|
|
Oh wow, that's a trip back. If you're seriously doing DOS graphics programming, you might want to spend some time with the old Abrash columns[^]...
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
Define Crazy: I spent days and almost $100 trying to track down that black book w/ the CD in good condition. So, I get it and it sits collecting dust alongside my other books. But, it does look neato sitting there.
|
|
|
|
|
Heh.
I think i first read it in electronic form; it came on CD with The Zen of Graphics. Gosh, it's been probably ten years or more since i bought that book... loved it though; the guy can really write.
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
Oh yeah, and if I ever end up dumb enough to write video drivers in DOS, well I'm set - minus the whole I don't know ASM *that* well thing thugh.
|
|
|
|
|
hi all,
in my project i need to convert raw image to bmp or jpeg and i have some images with the extention .gry i dont know this is raw or any other special format but i am thinking this is a raw format so my problem is convert .gry image to bmp or jpeg in c#
so plz any one knows the way how to do it is plz tell me
thanks in advance
Regards,
santhosh
|
|
|
|
|
You could use the System.Drawing.Bitmap class to create a bitmap of the appropriate bits-per-pixel
and copy the raw pixel data to it.
Do you have specs for the gry file format?
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
No mark i don't have any specs for that gry file according to my project document i have to take that gry image as input and displaying that into picture box
plz tell me the way how can i read this type of images in c#
and tell if any tutorial for this problem for reference
Regards,
santhosh
|
|
|
|
|
I'm not a C# programmer but C# uses .NET right? If so, check out the System.Drawing.Bitmap
class. If you have the dimensions and pixel format of the raw pixel data then you can create
a Bitmap object with the same format and copy the pixel data into it. Then it can be saved in
a variety of formats.
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
gry (or RAW GREY format) is an image format that is not supported by the image classes in .NET. This means that you are going to have to write your own converter I'm afraid.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete O`Hanlon wrote: This means that you are going to have to write your own converter I'm afraid.
I think that's what he wants to do. I'd post a C++ sample but I can't find any info on the
format. How to extract dimensions and pixel format would be helpful!
Do you know the Raw Grey format?
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
|
|
|
|
|
I don't use .NET, but the process will generally be the same. So, I'll speak in a bit of a psuedocode to get you pointed in the right direction at least.
Most RAW image files use the .raw extension out of custom although I've heard of .gry too so you're most likely right on that. Just Google for info on the RAW image file header format. To know how to make heads or tails out of the file data.
Here's one actually...
http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a88786/mm_raw.htm[^]
The good news is, a RAW image is raw data and a breeze to read into a buffer that libjpg or CreateBitmapIndirect() (Windows API) can understand. There are also a lot of unmanaged libs out there that will do this.
HTH
|
|
|
|
|
I have experience in doing graphics in vb5 but I am now using vb.net. I'm a little confused on how the new graphics system works. Could somebody show me some code that will do the eqivelent of the pset method. Also could somebody show me how to read the rgb values of a given pixel.
Thanks in advance for your help,
Mike
|
|
|
|
|
what does pset do ?
GetPixel is the easiest way to get a pixel value on an image.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: what does pset do ?
pset is VB's SetPixel if I remember correctly
Great job, team. Head back to base for debriefing and cocktails.
|
|
|
|