drawing icon with gdi+ in VC 6 #2

Hello,

I'm trying to draw an icon in a view.
First I used the simple gdi and I did like this : 

pDC->DrawIcon(rect_icon.left, rect_icon.top, hIcon);
and it was ok.

Then I changed to used the gdi+ and I do like this :

HICON hicon = myIcon;
Bitmap bitmap(hicon);
graphics->DrawImage(&bitmap, rct.GetRight() , rct.GetTop() , 32, 32);
it draw the icon but the quality is really bad, it looks like the
AntAliasingMode is on.
I've tried to change the option like using SetSmoothingMode and
SetPixelOffsetMode but it changed nothing, I can't have the same
quality of image as I have with the DrawIcon fonction.

Can anyone help me ?
Thanks in advance,

David
0
10/5/2004 3:40:07 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
439 Views

Similar Articles

[PageSpeed] 6

Reply:

Similar Artilces:

a new drawing not erase previous drawing?
visual studio c++ 6.0, mfc, graphics in my program a new drawing erases previous drawing. How to manage that all that is drawn stays alive on the window? And is not erased when the window is covered by another window, as well. And that the image does not flicker... Those last two have from time to time appeared in my attempts to solve the first problem. And that I didn't manage at all - make the first drawing, then the second, see them both at the same time on the window. I have tried the following and maybe more: Invalidate(false), InvalidateRect(false), override OnEraseBkgnd, ...

how to draw a bitmap transparently?
Hi, I have an owner draw button associated with a bitmap. In the bitmap editor, I turn off the option "draw opaque" for the bitmap. That is, I make it transparent. However, the the bitmap's background color still shows up on the button. The bitmap has only a solid circle in the middle. What else do I have to do? Please help. Thanks. Tony One thing you can do--and this works only for some restricted cases, which you may or may not have--is to make the button background 192,192,192, and when you LoadImage, you specify LR_MAP3DCOLORS. It will change the 192,192,192 to...

Visual C++6, MFC project to Visual Studio 2005 MFC
Hello, I convert a Visual C++6, MFC project to Visual Studio 2005 MFC and I have a lot of warnings. What I want? I want to sitch off the warnings and I make following without good result. How is the correct way to do this? File: stdafx.h #if ! defined(AFX_STDAFX_H__63C457B5_7B4F_11D5_A777_0001021D6D89__INCLUDED_) #define AFX_STDAFX_H__63C457B5_7B4F_11D5_A777_0001021D6D89__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define _CRT_SECURE_NO_DEPRECATE 1 #ifdef _MSC_VER_VS2005 # pragma warning(disable:4927) # pragma warning(disable:4244) # pragma wa...

owner draw CListBox, how to draw "no item found"
Hello, I have an owner draw listbox, in the DrawItem I draw the items. If the listbox doesn't contain any item I would like to display a message "no item found" but this is no item, so DrawItem is the wrong place. Where should I do this? OnPaint, OnEraseBkgnd? I thought I would be able to do something like this for a test (just paint the window blue) but it's always white BOOL CmyListbox::OnEraseBkgnd(CDC* pDC) { if (m_pItemList.GetCount() < 1) { CRect rc; GetClientRect(&rc); pDC->FillSolidRect(rc,RGB(0,0,255)); return TRU...

Primo Version 2.0 caused my Publisher file to crash-Version 1????
I've been reading the thread on Primo and am hoping that Joanne will contact me relative to sending me the original Primo download. I installed a new computer this weekend and didn't give a second thought to downloading Primo (which was recommended to me via this site a couple of years ago and has been working great in converting my Publisher files to PDF format). Although version 2.0 seemed to install OK, when I tried to convert a small Publisher file as a test, Publisher crashed, the document crashed, Microsoft Word crashed and my cable-connected printer wouldn't work. A...

install Windows Embedded CE 6.0
Hey, I've been looking everywhere online but I can not find an answer to this: I try and install Windows Embedded CE 6.0 on my PC. it says on the page how to do for vs 2005. can I use vs 2010? and how do I do it? On Mar 19, 9:18=A0am, Jonas F <Jonas F...@discussions.microsoft.com> wrote: > Hey, I've been looking everywhere online but I can not find an answer to = this: > > I try and install Windows Embedded CE 6.0 on my PC. it says on the page h= ow > to do for vs 2005. can I use vs 2010? and how do I do it? No, unfortunately you can't. It only wo...

Excel Database #2
Im trying to create a database on my excel spreadsheet so i can then analyse this data using graphs etc..... Basically i have a form with 6 fields on it. What i want to do is to have people type in entries to this form and then click on a button to transfer all this data accross into another worksheet under the same field headings. Now i have the form all set up and ready and a button attached ready for a macro to be assigned to it. The problem i have is when i create a macro to transfer the entries across it works the first time but then every time i do it, it just overwrites the previous en...

Exchange Mailboxes #2
I have a SBS 2003 server that had probelsm with the initial load. I finally have the 2003 Exchange server loaded and working however, Accounts that were created before the Exchange server was loaded properly do not have any of the Exchange Tabs in the User properties. New Accounts are created with these and look just fine. How do I go back and add the original users to exchange without creating new user accounts for them? -- Skip you could just create new mailboxes for them...but the old data would not be there...did you save the old store/s? "ChiefSkip" <ChiefSkip@discu...

Line chart: Dates in uneven intervalls on x-achsis #2
'Supplementary' questions: Is there a clever way to make excel recogniz that '3 months' stands for '0.25 years', and '6 months' stands for '0. years'? I know, this is only cosmetics. Nevertheless it would be interesting ;) Gil -- gdavid ----------------------------------------------------------------------- gdavids's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1589 View this thread: http://www.excelforum.com/showthread.php?threadid=27378 You could use a helper column that divides months by 12 to scale as years. Jer...

Reports #6
Setup: Server A is CRM 4.0 Rollup 2 Server B is SQL 2005 w/SP2 and SSRS connector Server A has two orgs installed: Production and Test. Reports work great on Test, no problems at all. However, on Production reports are met with the following error: The permissions granted to user 'domain\server$' are insufficient for performing this operation. I have not found any solutions for CRM servers that are running multiple tenants. I checked the report server settings on the two orgs and they are indentical. I have also checked the DB settings on the SQL server and they are identic...

Draw a horizontal line after the last record is printed on each pa
The details section of my report draws vertical lines which grow to accomodate text size changes. I would like to have a horizontal line drawn when last record finishes printing on the page and joins the end of the last vertical line to make a table. Please help. Thanks. -- Lydia Liu Access/VB Programmer There was at least one answer posted to your same question yesterday. -- Duane Hookom Microsoft Access MVP "Lydia" wrote: > The details section of my report draws vertical lines which grow to > accomodate text size changes. I would like to ha...

Full Page Receipt with Supplier #2
Customer Source has several Receipt formats to download that have MSRP and Bin Location. Microsoft should have a full page receipt that also list the supplier by each item. I tried manually editing a receipt to get this result and I could not. The supplier always said 0. It shouldn't be to hard for microsoft to modify a full page receipt to allow this. Thanks, Neil ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do no...

Desktop Icons 04-23-10
Is there a way to set the background color at the icon name to "clear", or no color at all? I have one computer that does it but I don't know how it got that way. ...

Placing icons in front of list box items
Gentlemen (no offence meant to females as I've never noticed them in this forum), I'm struggling with the challenge to put graphic icons in front of the list box's entries. The reason why I need this is that the list box (a part of CPropertySheet/ CPropertyPage - based dialog) has to include items of a different nature (e.g. users, computers, etc.), thus making it quite difficult to distinguish them if such suggestive icons are not utilized. Can anyone share his expertise please ? Thank you so much, Andrew K. Look at codeguru and codeproject. There are number of examples ...

Forwarding mail through exchange 2003 #2
Just installed exchange 2003 on network that is using unix mail which is Pop 3. We are setting up exchange but want to forward mail from exchange to the unix server until we make the cut over. Could someone help me with setting up forwarding on the exchange server to unix mail. Thanks. Properties of the Default SMTP server. Messages tab, Forward All Mail With Unresolved Recipients To Host field. HTH N. "Earl" <anonymous@discussions.microsoft.com> wrote in message news:a0bd01c3eb29$6cde7290$a401280a@phx.gbl... > Just installed exchange 2003 on network that is using ...

Anyone want to draw roads?
Just thought that if anyone wants to do diagrams with roads or rivers as double lines then Jeff Lanam (this n/group) kindly provided me with this link to a free programme called OCAD. Its a tiny file, is EASY to use and the results can be exported as a .bmp into Publisher. www.ocad.com I asked on this newsgroup how to achieve this and many threads resulted, so thought I'd post the solution. Many thanks Jeff (see reply to your post) Chrissss........ Glad you solved your map problem. An interesting program. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.o...

SumProduct 2
Here is my data: End date............Sus Date............ID# 05-Feb-03.......... 07-Feb-03.........28-Feb-03..........8 15-Mar-03......... 28-Mar-03......... 23-Apr-03........ 30-May-03......... 24-Jun-03........ 27-Jun-03.......... 08-Aug-03.......... 15-Aug-03.........03-Oct-03..........6 22-Aug-03........ 29-Aug-03....... 19-Sep-03....... 30-Sep-03........ 30-Sep-03....... 02-Oct-03....... 31-Oct-03....... 07-Nov-03.........02-Dec-03 12-Dec-03.......04-Dec-03 19-Dec-03....... 19-Dec-03........ All of the data above have ID #'s (I left it out), but only some ID#' have a SUS Date, ...

Drawing graphs on Modal dialogs
I've encounter a strange phenomenon: I have an MFC application that creates a child dialog using DoModal(). Within this child dialog I have a couple of buttons and a graph plot drawn within the area of a Cstatic using a third party API from GraphicsServer. This modal dialog has a minimize button, but when I minimize the dialog, the graph doesn't minimize with the dialog is always on top of the screen. Has anyone encountered this problem? Do you think is is a GraphicsServer issue or a Microsoft issue? I've called Graphics Server and they say that they haven't countered my proble...

Border #2
I cannot figure out how to add a border to a banner in Pub. 2003. Can anyone help? After managing to set up OE-QuoteFix on his new PC, Ed reads a message from Kyle <anonymous@discussions.microsoft.com>... > I cannot figure out how to add a border to a banner in Pub. 2003. If you just want a border around the banner, you can create a big rectangle and set BorderArt onto that. -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this message, view the disclaimer: http://mvps.org/the_nerd/disclaim.htm ...

Using Icons with PasteFace and C++
I'm trying to set a button face for CommandBar in Outlook, I'm using C++ Here is the code I'm using, but all I get is a blank face. I'm thinking that I need to actually create a new copy of the clipboard bitmap but I'm not sure how to do that ... any ideas please? m_pCmdNewJournal->m_pButton->CopyFace(); OpenClipboard(NULL); hBitmap = (HBITMAP)GetClipboardData(CF_BITMAP); CopyIconToBmp(IDI_ACTIVITS, hBitmap); SetClipboardData(CF_BITMAP, (HBITMAP)bm); CloseClipboard(); m_pCmdNewJournal->m_pButton->PasteFace(); void COutlookButtons::CopyIconToBmp(WORD wResourc...

Microsoft Form 2.0 Image help...
Hello. I hope this is the right news group for this. I'd like to make a program which shows image file list on the left side in list control and image window on the right side that'll be shown the image file selected in the list. This is diaglog-based app. When showing image on the dialog, I found the default picture control is not good answer here. Cause there're images with a little different image format.(GIF, JPG, BMP) So I'd like to use Microsoft Form 2.0 Image control for this. It works fine in dialog design phase so the first picture is displayed properly. But I can&#...

From field #2
I have three email accounts, how do I select the one I would like to have as a return address for any given email I send out? Thanks! IIRC, I have not yet used Outlook 2003. :[ IIRC, Outlook 2002 has an "Accounts" menu option when composing an e-mail. You may have to customize your toolbar to see it. IIRC, Outlook 2000 has a "send using" menu option when composing an e-mail. You may have to customize your toolbar to see it. IIRC, Outlook 98 and 97 don't offer this. Ray at work "gare" <gare@whatidliketosay.com> wrote in message news:058d01c39d5...

Modified date #2
Hi, We have a sheet with several rows and columns that are sometimes updated. What we want is a date in a column "Modified Date" when something in that row is modified. Is this possible? Best regards Hi prixton If you change a cell in Col A:G the date will appear in the H column Copy this event in a sheet module Private Sub Worksheet_Change(ByVal Target As Range) Dim cell As Range For Each cell In Target.Cells If Target.Column < 8 Then Cells(cell.Row, "H").Value = Format(Now, "mm-dd-yy hh:mm:ss") End If Next End S...

Money Small Business #6
I'm having trouble properly recording my business income (cleaning service). I enter the deposit (manual check deposit) under 'Service Income', but still in the business snapshot I have zero revenue! If I set up recurring clients it will show up under 'Payables due by...' and like ($240) <== in red, meaning it's a negative bill?! It would be great to see my revenue and expense in the same snapshot. Can anyone help me with that? ...

Where did the drawing go?
Visio 2003 SP2 with all the latest patches. I have an extensive floor plan created in a file. I renamed the page by double-clicking on the tab and replacing the name with 'Current'. I then added a page and called it 'Proposed'. The program hour-glassed for a bit which I thought was curious and then hung. I could close the program and since I did some editing on the file, I saved it when prompted. The next time I opened the file, the design was not visible and the scale was literally off the charts (it says X = - 46 ft., Y = 89478492 ft. 6, and if I go into Page Setup a...