-
October 19th, 2001, 09:55 AM
#1
GRAY LEVEL IMAGE AS AN ARRAY
I have an array of Gray level values.
i want to display this on document area.
i know to display it with SetPixel function.
but i want something, to display it fast.
can i use the pointer corresponding to the display and for this purpose ????
==============
Bye 4 now
MAD
-
October 19th, 2001, 10:14 AM
#2
Re: GRAY LEVEL IMAGE AS AN ARRAY
Could you draw those values into a bitmap in some initialization code or are the values changing a lot? If they are not changing, draw them into a memory DC with a bitmap selected into it, then when you want to draw, just call BitBlt. If you want some code to do this, I can post some.
Chris Richardson
http://www.geometriccomputing.com
http://www.imagesensing.com
http://www.autoscope.com
-
October 19th, 2001, 11:15 PM
#3
Re: GRAY LEVEL IMAGE AS AN ARRAY
thanx 4 the suggetion,
how can i transfer the array in to bitmap,
r u saying about DC ?
then
Shoud i use SetPixel() itself for that
bye 4 now
==============
Bye 4 now
MAD
-
October 21st, 2001, 09:23 AM
#4
Re: GRAY LEVEL IMAGE AS AN ARRAY
You should look at some of the DIB classes found in the Bitmap section. Using one,
you can directly access the pixels before drawing to your document. And it is
so much faster compared to using SetPixel().
good luck.
-
October 22nd, 2001, 10:15 AM
#5
Re: GRAY LEVEL IMAGE AS AN ARRAY
Hey man, I want to do the same thing. I'm a beginner to Visual C++, but I know some C/C++.
I want to read BMP-file, play with it a bit(array is preferable), and the display it. And I want to do it the easy understandable way. Back in the old days(DOS-based compilers) it wasn't that hard to read a BMP-file. I thought it would be lot easier with Visuall C++...
-
October 22nd, 2001, 10:23 AM
#6
Re: GRAY LEVEL IMAGE AS AN ARRAY
You could use SetPixel if you wanted to. Otherwise, you could directly access the pixels without using SetPixel. You just need to use CreateDIBSection. This function will give you an HBITMAP (which can be used for drawing), and it will also give you direct access to the bits.
Chris Richardson
http://www.geometriccomputing.com
http://www.imagesensing.com
http://www.autoscope.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|