display a JPEG image on a 8 bit screen color depth

Hi


My application uses VC++ 6.0. Could anyone help me out by letting me
know how could I display a JPEG image on a 8 bit screen color
depth.This JPEG image is getting displayed using my app. when i use a
16 bit screen color depth.Is there any function by which i can manually
specify the bitmap color depth  in my app.


Thanks a lot.

Anita

0
7/24/2006 4:32:41 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
240 Views

Similar Articles

[PageSpeed] 51

You could look at GDI+ or check out what code might be available at www.codeproject.com
				joe

On 24 Jul 2006 09:32:41 -0700, anita.k.123@gmail.com wrote:

>Hi
>
>
>My application uses VC++ 6.0. Could anyone help me out by letting me
>know how could I display a JPEG image on a 8 bit screen color
>depth.This JPEG image is getting displayed using my app. when i use a
>16 bit screen color depth.Is there any function by which i can manually
>specify the bitmap color depth  in my app.
>
>
>Thanks a lot.
>
>Anita
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
7/24/2006 4:40:05 PM
anita.k.123@gmail.com wrote:
> Hi
>
>
> My application uses VC++ 6.0. Could anyone help me out by letting me
> know how could I display a JPEG image on a 8 bit screen color
> depth.This JPEG image is getting displayed using my app. when i use a
> 16 bit screen color depth.Is there any function by which i can manually
> specify the bitmap color depth  in my app.
>
>
> Thanks a lot.
>
> Anita


hi anita,
i did something similar long time ago, must be under win 3.1 or so.

think you (still) have to do reduce the color information by yourself
to create a 256 color table - actually you've got only about 220 colors
for use by yourself cause some color table entries are reserved for the
system.
there already some algorithms to do color reduction like
* nearest color
* error diffusion
* floyd steinberg

the GDI offers some functions to handle 256 color palettes like
CreatePalette()
SelectPalette()
RealizePalette()
UnrealizePalette()
....

the handling of palettes (if i remember correctly) is like juggling, if
your window gets the focus, you must set your palette and redraw your
image, if it looses the focus, you must restore the system palette and
redraw your image (which at this time looks usually very ugly due to
the mapping of your colors to the system palette).

when i program a graphics application which shows hi/true color images
i usually deny the execution of the program when running under a 256
color mode. it's just too much affords to support this.

have a nice day,
martin

0
7/25/2006 5:41:08 AM
Reply:

Similar Artilces:

Dual Displays
I want to connect my Sharp Aquos flat screen TV to my computer, and see my desktop on both the TV and computer monitor. Windows Vista Home Premium. HP Pavilion a1610n computer. Galaxy GeForce 8400 GS graphics card, outputs: 1-VGA, 1-DVI, and 1-SVGA. There is no HDMI port on the card. I connected a VGA cable between the motherboard "on-board" VGA port and the TV, figuring that I could use that output to work with the TV. The computer monitor is plugged into the GeForce graphics card. Tried the Desktop "Display Setting". It says, the number 2 monitor is "N...

Ivy color scheme
Greetings Can anyone tell me the colors (hex values) used in the ivy color scheme in publisher? I do not have publisher. Thanks Albatross I don't have the hex values but I did do the work for the RGB numbers. (I'm kinda surprised I'd do this much work for something this strange.) If you don't have Publisher, how do you know about the Ivy scheme? If it was through an acquaintance, why not ask the friend? Main - black Accent 1: R-51, G-102, B-0 Accent 2: R-204, G-204, B-153 Accent 3: R-214, G-224, B-214 Accent 4: R-204, G-204, B-204 Hyperlink: R-51, G-153, B-0 Followed link:...

Display a message box "this entry is a duplicate"
How can I display a message box on a form if the shipment number is a duplicate? I need a message box to pop up when user attempts to tab out of the field. Thank you. Something like: Private Sub txtShipNum_BeforeUpdate(Cancel As Integer) If DCount("*", "MyTable", "ShipNum = '" & Me.txtShipNum & "'") > 0 Then Msgbox Me.txtShipNum & " already exists." Cancel = True End If End Sub This assumes that your text box is named txtShipNum, that the name of the field in table MyTable is ShipNum...

Folder could not be displayed
I am running Windows XP and Outlook Express 6 just fine then one day my husband does something to my computer and his email account won't work. My email is working just fine but in his he cannot open his inbox. It says folder could not be displayed, and when you send and receive it gives you this error message: "An unknown error has occured. Account: 'incoming.verizon.net'. Server:'incoming.verizon.net'.Protocol:POP3, port: 110, Secure(SSL): No, error number: 0x800C013B" If anyone could help me with this I would greatly appreciate it. Thank you T...

Adding JPG image to resource Changes its color
Hi, I have tried to add the JPG images to the resource script. but when I export this images back it gives image with less color. Why So? I need to have JPG images with the application, I do not wish to have relative path ? Please let me know the possible solution for this Thanks Anup The Visual Studio IDE doesn't display graphics correctly if they have more than 256 colors or the pallette is non-standard. You can still use them, you just can't modify them or display them in the IDE. You need to import the graphic items rather than using something like cut and paste to ad...

Driver for "Generic Color PS for Commercial Printing" in Publisher 2003 and Win 7, X64
Hello Listis, until last week I used with Publisher 2003 under WIN XP, X32 with the Postscript Printer as above mentioned. Now I have WIN 7, X64 installed but it isn't possible to install the Printer "Generic Color PS for Commercial Printing" with MSCOL11.INF. How can i install this printer or a similar printer? Thanks Josef ...

Upside Down & Mirror Images of Pictures
Our company has an Excel Spreadsheet expense report master with our company logo inserted in a set of merged cells. When viewed/used in Excel 2002, the logo is upside down and a mirror image of what is shown in Excel 2000. I checked and some other 2000 spreadsheets with this logo appear OK when viewed in 2002. I guess the Master report on our LAN could be edited with 2002 to fix this problem. But my concern is if this does happens on other documents created in Excel 2000 or before, it could be rather embarrassing if those documents are sent to a client. Anyone seen this before? Any...

how to display values in 3 cells into one cell
Anyone can help me how do I display the 3 separate different values in 3 cells into just one single cell ? thanks so much in advance. Either there was a typo or there's an echo in here. That line should have been: = A1 & " " & B1 & " " & C1 "Bradley Dawson" <bradleydawson@earthlink.net> wrote in message news:l464b.2224$Lk5.2093@newsread3.news.pas.earthlink.net... > In the target cell, type: > > = A1 & B1 & C1 > > where A1, B1, C1 are the cell addresses that you want to concatenate. > > If these have number...

How to select & display distinct values
Hello, I need help with a form please. My form has two controls, the first being a combo box. This box should select the company name from a lookup table. The lookup table has only two companies in it, however, they each are repeated several time. Company 1 has about 10 rows, company 2 has 3 rows. I used the query builder and came up with the statement: "SELECT DISTINCT Lktbl_Role_Master.CompanyName FROM Lktbl_Role_Master;" When I run the statement directly from query view, it executes perfectly and returns exactly two rows (one for each company, in a datasheet view) ho...

Display Time in Outlook
The time setting in my Outlook is one hour behind my actual time. I cannot determine how to change the time. Outlook is the only item that is incorrect. Other display times in operating system are correct. Thanks, Jodi ...

PK and FK Displayed
I am a complete Visio newbie, and cannot find the answer I need in books or online help. I am trying to create ER diagrams from scratch, and not connected to real tables, using VEA. I have added tables ('Entities') to the form, connected them with a Relationship connector, and, in the Database Properties window I've assigned the end points to a Primary Key on the left and a Foreign Key on the right. But the model shows the connector as running between the top colums on both sides, whereas I want the keys to be in that upper box and provide the connector's end points. Wh...

Validation of Image Path
I have a subform with an image on it that I'm using on the main form. Since I'm using my flash drive {E} instead of C:\ drive, when I run the program it keeps on telling me that the image can't be loaded/found or something like that.. In the Picture control: C:\NCI Taps\NCI Pictures\NA.bmp Picture type is: Linked Is there a way where some code will check the validation of that path and picture or some way where "On Load" the control can be set to the current path? Within the regular forms the picture will show up and work "On Current". This is t...

Formulas are displayed, results are not
Hello, For some reason, when I enter a formula into a cell and press enter, the formula just stays there. Anyone know what I can do to show the results? I tried pressing Cntrl + `, but that didn't work. FYI, when I cut and paste a column from a separate workbook, that column works like normal (i.e., the formulas produce results). Thanks for any suggestions! Hi Mike, Maybe your cell is preformatted as Text. Try formatting to general then erase your = and type it in again. HTH Martin "Mike C" <js2k111@yahoo.com> wrote in message news:f699bcd4-ad82-4a88-9759-5638c147b...

Stop displaying a line
I have a line graph/chart and it gets its values using a formula and the values of another column. However this poses a problem because if there is nothing in the targetted column the formula returns 0 cause the line to drop to the bottom, instead of casuing the line to just end until a value is added to the target column. How can I do this? Change your formula to use NA() if the cell is empty. For example: =IF(A1="",NA(),A1) To hide the resulting #N/A errors on the worksheet, you can use conditional formatting. There are instructions here: http://www.contextures.com/xlC...

unattached textboxes disappear when a msgbox is displayed on a tab control
I'm using Access 2003. I have a form with a tab control on it. I was having problems with labels flashing and I followed the suggesting from Allen Browne - http://allenbrowne.com/ser-46.html. The flashing went away but now when a msgbox is displayed the unattached textboxes that I'm using as labels disappear. They come back as soon as the msgbox is removed from the screen. I've searched google looking for an answer but have come up short. Does anyone know why I'm experiencing this behavior and how to make it go away? Thanks, Rick That *is* strange. Have you tr...

A question about Console window(display or not display)
I've redirected the (stdin stdout stderr) of a console window process I spawned to a pipe. And I want to display the redirected console window, the question is: If I display it(set Create_new_CONSOLE in createprocess and some flags in startupinfo), I cannot use the redirected way of pipe, which means if i do not display, i can use the pipe communicating with the child process. Does it mean that as long as I disply the console window, windows will change stdin stdout to "screen&keyboard" instead of my pipe? That's right. If you redirect stdin or stdout then you preemp...

SFO missing from VPC images????
Hi all, I have just successfully installed the VPC demo images for the server and the client. Everything works great except that the SFO add in is missing from Outlook on the client install. I have added the crmaddin.dll and verified that the CRM folder is there under c:/programs...I am loggin in as the Gail Walker user that the install doc says has SFO installed and nothing...any ideas? Thanks in advance. Try clearing your custom form cache, adding additional cache and removing/readding the addin. To clear cache: 1. From the Outlook Main Menu, select Tools/Options/Other tab. 2. Press th...

Changing Screen Resolution
How can I change the resolution of the screen when the app start and return it's last resolution when the app be closing. > How can I change the resolution of the screen when the app start and return it's last resolution when the app be closing. Hector, See the ChangeDisplaySettings API documentation. If you want to do it for an arbitrary application, you could use VidRes (www.jddesign.co.uk) to launch the application and perform the resolution changes for you. Dave -- MVP VC++ FAQ: http://www.mvps.org/vcfaq ...

Display or not display series
I have a graph with four series but some of the series may be blank, i.e. the series name is <blank series>. Is there a way to not display these series on the graph and/or legend if they are blank, and display them if they are without deleting the series? Thanks! Clay Create a chart from all the data Select the data on which the chart is based. Choose Data>Filter>AutoFilter In the heading cell for the series name column, select (NonBlanks) from the dropdown list The series with blank name cells will be hidden in the chart. Clay wrote: > I have a graph with four serie...

does Excel support multiple display monitors?
Hello All Excel Experts How do I move chart windows to multiple display montors?? (one computer runnng three monitors... Excel Charts will not move off the primary monitor. Your advice is EXTREMELY appreciated thanks. Denni ...

Displaying an equation
I have an equation setup that is referencing a few other cells that have equations in them. I want to have a cell that displays this equation with the answers that are calculated from these other cells displayed as values in the new equation. Any help would be greatly appreciated. Thanks Check out http://www.mvps.org/dmcritchie/excel/formula.htm#getformula In article <E4143E2B-360A-4B43-955F-73BF8EC60694@microsoft.com>, "hoising8" <hoising8@discussions.microsoft.com> wrote: > I have an equation setup that is referencing a few other cells that have > eq...

Command button colors
Are there other options for command button colors...other than grey, or transparent? Shael wrote: > Are there other options for command button colors...other than grey, > or transparent? Not without using an image for the background or some other work-around. Stephen Lebans has some methods for doing this I believe. You might check his web site. -- Rick Brandt, Microsoft Access MVP Email (as appropriate) to... RBrandt at Hunter dot com Check what Stephen Lebans has at http://www.lebans.com/cmdbutton.htm -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no...

Pie Chart
Hello. I am trying to create a pie chart with 10 labels each linked to a cell of the same value, so the pie pieces are of a uniform size. I would like to know if there is a way to color the pieces based on a conditional data from other cells? Specifically I am wanting to colors to be assigned in the following example: Red if cell=1 yellow if cell>1,<4 Green if cell>=4, <=5 Example: lets say label 1 is linked to A1 which has the value of 3, label 2 is linked to A2 which has a value of 4, and label 3 is linked to A3 which has a value of 1. The labels would be colored Yellow, Green, ...

Serialisation
A general query Im serialising a person object with the following member variables Class Person Private _forenames As String Private _surname As String Private _dob As Date Private _marital_status As MaritalStatus 'Public Get and Set Properties here for each of the above ' I'll not detail them all to save space but Ill show attributes <XmlElementAttribute(Elementname:="forename")> _ <XmlElementAttribute(Elementname:="surname")> _ <XmlElementAttribute(Elementname:="dob"...

Inserting image file through ADO
Hello, I am generating excel sheet through ADO (ISAM) but how to insert some image? Thank you Regards Raj ...