Link to home
Start Free TrialLog in
Avatar of amavr
amavr

asked on

Monochrome monitor

Hi,

I have a picture box with a certain BMP.
If I'm running my application in Monochrome monitor, the picture became totally black, but if I'm opening the same BMP in Paint application it looks good (all colors are transformed to grey colors)

How can I display the picture in VB ?

Many thanks
Avatar of Toad224
Toad224
Flag of United States of America image

geez... who has a monochrome monitor.. lol...  If the bitmap is supposed to be a color one, try opening it up in Paint again, and choosing Save As, and in the Save Type as box, try the different settings available...  Monochrome, 16 color, 256 color, 24-bit... and save the file, and try opening the new saved file with VB.

If you're not looking to display a specific bitmap, and perhaps letter the user choose one to open, you should look at the WinAPI functions for other methods of displaying bitmaps instead of using the picturebox in VB.

I hope that helps.  Good luck!
Avatar of amavr
amavr

ASKER

The Monochrome monitor is in use in medical applications.

I do need to load many different BMP's and JPG's dynamically - the pictures created while the program is running so I cannot use SaveAs option.

thanks
I would have to agree with Toad...you may be better off looking into API functions rather than using the picturebox.
hmm... really?  There are actually medical devices that run Windows with VB programs...

Does the picture display correctly in Internet Explorer?  If it does, I suppose you could use the Internet Explorer ActiveX control.  What other ways have you tried displaying it?  Does it display properly in any other programs you have tried?
Well, there is a difference between monochrome and greyscale.  Monochrome means one single color or shade.  So, VB is going to look at the bitmap and ask if each pixel is closer to white or black, and then turn the pixel to that.  

If you need the bitmap to look good under Monochrome, then as Toad224 suggested, bring the bitmap into Paint and reduce the colors to Monochrome.  It's likely that paint will do a better job of the conversion than the picturebox control would.

If you want to have a color bitmap for people with color monitors, and a black and white one for monochrome monitors, then you'd probably want to use two separate bitmaps and then check the system's display properties before loading the bmp to decide which one to load.
Avatar of DanRollins
Hi amavr,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Refund points and save as a 0-pt PAQ.

amavr, Please DO NOT accept this comment as an answer.
EXPERTS: Post a comment if you are certain that an expert deserves credit.  Explain why.
==========
DanRollins -- EE database cleanup volunteer
ASKER CERTIFIED SOLUTION
Avatar of SpideyMod
SpideyMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial