 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Michael Fritz Guest
|
Posted: Mon Nov 22, 2004 3:40 pm Post subject: DrawIcon into TPaintBox draws ugly |
|
|
Hi,
I'm using DrawIcon to draw an icon from a resource file onto a TPaintBox.
The resource file or better the icon has got a 48 x 48 icon with a color
depth of 256 colors.
The paint box is of 48 x 48 - exactly like the icon I want to paint.
However the drawn icon seems to be smaller and looks like DrawIcon() had
resized it.
Is DrawIcon capable of doing this? If so how do I prevent this function to
not behave like this?
Thx,
--
cu,
Michael
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Mon Nov 22, 2004 7:13 pm Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
In article <s8gfz8uel1zh.dlg (AT) die-fritzens (DOT) de>, Michael Fritz wrote:
| Quote: | I'm using DrawIcon to draw an icon from a resource file onto a TPaintBox.
The resource file or better the icon has got a 48 x 48 icon with a color
depth of 256 colors.
The paint box is of 48 x 48 - exactly like the icon I want to paint.
However the drawn icon seems to be smaller and looks like DrawIcon() had
resized it.
Is DrawIcon capable of doing this? If so how do I prevent this function to
not behave like this?
|
Use DrawImage or DrawIconEx instead, it allows you to specify the size you
want. DrawIcon always draws a 32*32 icon.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
Michael Fritz Guest
|
Posted: Mon Nov 22, 2004 7:40 pm Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
Am Mon, 22 Nov 2004 20:13:27 +0100 schrieb Peter Below (TeamB):
| Quote: | Use DrawImage or DrawIconEx instead, it allows you to specify the size you
want. DrawIcon always draws a 32*32 icon.
Peter, |
I tried to locate DrawImage function/procedure. Where did you find it using
e.g. D7?
--
cu,
Michael
|
|
| Back to top |
|
 |
Michael Fritz Guest
|
Posted: Tue Nov 23, 2004 10:24 am Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
"Michael Fritz" wrote in message <news:s8gfz8uel1zh.dlg (AT) die-fritzens (DOT) de>:
Posted an example of result of DrawIcon into b.p.att.
Please take the second posting because the jpg in the first does not work
:-(
--
cu,
Michael
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Tue Nov 23, 2004 7:57 pm Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
In article <10rrimbp57m2f$.dlg (AT) die-fritzens (DOT) de>, Michael Fritz wrote:
| Quote: | Use DrawImage or DrawIconEx instead, it allows you to specify the size you
want. DrawIcon always draws a 32*32 icon.
Peter,
I tried to locate DrawImage function/procedure. Where did you find it using
e.g. D7?
|
Sorry, i misremembered, DrawImage is a GDI+ method. Use DrawIconEx, see
win32.hlp.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
Michael Fritz Guest
|
Posted: Wed Nov 24, 2004 9:03 am Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
"Peter Below (TeamB)" wrote in message
<news:VA.0000b53f.008a5923 (AT) nomail (DOT) please>:
| Quote: | Sorry, i misremembered, DrawImage is a GDI+ method. Use DrawIconEx, see
win32.hlp.
Thanks Peter, however this does not help either. Did you have a look at my |
next posting dealing with the posting I've sendt to b.p.att.?
--
cu,
Michael
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Wed Nov 24, 2004 6:36 pm Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
In article <zrhtsnf3f3kn$.dlg (AT) die-fritzens (DOT) de>, Michael Fritz wrote:
| Quote: | Sorry, i misremembered, DrawImage is a GDI+ method. Use DrawIconEx, see
win32.hlp.
Thanks Peter, however this does not help either. Did you have a look at my
next posting dealing with the posting I've sendt to b.p.att.?
|
No. I'll try to remember to do that tomorrow. I don't have a permanent
online connection, so it's a bit awkward for me to get things out of
b.p.attachments on short notice.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
Michael Fritz Guest
|
Posted: Thu Nov 25, 2004 10:32 am Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
"Peter Below (TeamB)" wrote in message
<news:VA.0000b549.004fa868 (AT) nomail (DOT) please>:
| Quote: | No. I'll try to remember to do that tomorrow. I don't have a permanent
online connection, so it's a bit awkward for me to get things out of
b.p.attachments on short notice.
Thanks Peter for keeping this in mind anyway! |
--
cu,
Michael
|
|
| Back to top |
|
 |
Peter Below (TeamB) Guest
|
Posted: Thu Nov 25, 2004 6:39 pm Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
In article <189f8u9csljss.dlg (AT) die-fritzens (DOT) de>, Michael Fritz wrote:
| Quote: | No. I'll try to remember to do that tomorrow. I don't have a permanent
online connection, so it's a bit awkward for me to get things out of
b.p.attachments on short notice.
Thanks Peter for keeping this in mind anyway!
|
You are using LoadIcon to get the icon from resource. And the SDK docs for
this function have this remark: "LoadIcon can only load an icon whose size
conforms to the SM_CXICON and SM_CYICON system metric values. Use the
LoadImage function to load icons of other sizes."
This limitation of LoadIcon is the source of your trouble. So do as MS
suggests and use LoadImage instead.
--
Peter Below (TeamB)
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be
|
|
| Back to top |
|
 |
Michael Fritz Guest
|
Posted: Thu Nov 25, 2004 7:36 pm Post subject: Re: DrawIcon into TPaintBox draws ugly |
|
|
Am Thu, 25 Nov 2004 19:39:04 +0100 schrieb Peter Below (TeamB):
| Quote: | You are using LoadIcon to get the icon from resource. And the SDK docs for
this function have this remark: "LoadIcon can only load an icon whose size
conforms to the SM_CXICON and SM_CYICON system metric values. Use the
LoadImage function to load icons of other sizes."
This limitation of LoadIcon is the source of your trouble. So do as MS
suggests and use LoadImage instead.
Oh I never guessed that LoadIcon is the cause of this problem- THANKS! |
--
cu,
Michael
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|