-
Jun 9th, 2013, 07:16 AM
#1
Thread Starter
PowerPoster
about LoadImage(): what images files can read?
what images files the Loadimage() can read?
(i understand that can read ico, cur, ani(by 1 subimage at a time, because they are cur image format) and bmp. but other images like png, jpg, gif????)
-
Jun 9th, 2013, 09:42 AM
#2
Re: about LoadImage(): what images files can read?
I believe PNG is supported only in icons, i.e., individual images in an icon compressed using the PNG format. The LoadImage's uType parameter clearly states that only the following image types are supported:
Value |
Meaning |
IMAGE_BITMAP
0 |
Loads a bitmap. |
IMAGE_CURSOR
2 |
Loads a cursor. |
IMAGE_ICON
1 |
Loads an icon. |
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 9th, 2013, 11:47 AM
#3
Thread Starter
PowerPoster
Re: about LoadImage(): what images files can read?
Originally Posted by Bonnie West
I believe PNG is supported only in icons, i.e., individual images in an icon compressed using the PNG format. The LoadImage's uType parameter clearly states that only the following image types are supported:
Value |
Meaning |
IMAGE_BITMAP
0 |
Loads a bitmap. |
IMAGE_CURSOR
2 |
Loads a cursor. |
IMAGE_ICON
1 |
Loads an icon. |
and the gif's??? what format they have? or are independent?
(my bad... the ani is read with LoadCursorFromFile() and DrawIconEx() and DestroyCursor()(after we don't need it)
-
Jun 9th, 2013, 12:02 PM
#4
Re: about LoadImage(): what images files can read?
Originally Posted by joaquim
and the gif's??? what format they have? or are independent?
The GIF format is somewhat like PNG but LoadImage does not support it. Neither is JPEG.
Originally Posted by joaquim
(my bad... the ani is read with LoadCursorFromFile() and DrawIconEx() and DestroyCursor()(after we don't need it)
LoadImage can, in fact, load animated cursors:
Originally Posted by MSDN
Loads an icon, cursor, animated cursor, or bitmap.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 9th, 2013, 12:10 PM
#5
Thread Starter
PowerPoster
Re: about LoadImage(): what images files can read?
Originally Posted by Bonnie West
The GIF format is somewhat like PNG but LoadImage does not support it. Neither is JPEG.
LoadImage can, in fact, load animated cursors:
ok, is there another API function for read the jpeg and png?
i have code for read png but it's very complext for translate... so is there another API function?
-
Jun 9th, 2013, 12:16 PM
#6
Re: about LoadImage(): what images files can read?
Well GDI+ should be able to deal with PNGs but the API is a little more complicated that regular old GDI. If you're using VB6 and want PNG support then I recommend using the FreeImage library. I've used it in the past and its really great.
-
Jun 9th, 2013, 12:19 PM
#7
Thread Starter
PowerPoster
Re: about LoadImage(): what images files can read?
Originally Posted by Niya
Well GDI+ should be able to deal with PNGs but the API is a little more complicated that regular old GDI. If you're using VB6 and want PNG support then I recommend using the FreeImage library. I've used it in the past and its really great.
sorry.. in these case isn't for VB6, that's why i ask for another API function.
anotherthing: what is metafile?
-
Jun 9th, 2013, 12:32 PM
#8
Re: about LoadImage(): what images files can read?
Originally Posted by joaquim
anotherthing: what is metafile?
If I'm not mistaken, I think it's a file that describes another file.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jun 9th, 2013, 12:34 PM
#9
Re: about LoadImage(): what images files can read?
An image file essentially records the values and arrangement of pixels. A metafile is vector based. In other words it records instructions for drawing the image rather than the image itself. This is specifically designed to make scaling of the image over large ranges possible without quality loss which is why it has tended to be the format of choice for clipart, for example.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
Jun 9th, 2013, 12:37 PM
#10
Thread Starter
PowerPoster
Re: about LoadImage(): what images files can read?
Originally Posted by dunfiddlin
An image file essentially records the values and arrangement of pixels. A metafile is vector based. In other words it records instructions for drawing the image rather than the image itself. This is specifically designed to make scaling of the image over large ranges possible without quality loss which is why it has tended to be the format of choice for clipart, for example.
thanks to all
-
Jun 9th, 2013, 12:54 PM
#11
Re: about LoadImage(): what images files can read?
Originally Posted by joaquim
sorry.. in these case isn't for VB6, that's why i ask for another API function.
anotherthing: what is metafile?
Then I guess your only route may be GDI+.
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
|