PureBasic Forum
https://www.purebasic.fr/english/

LoadImage... and ImageLists
https://www.purebasic.fr/english/viewtopic.php?f=5&t=2911
Page 1 of 1

Author:  BackupUser [ Sun Jan 13, 2002 12:25 am ]
Post subject: 

Restored from previous forum. Originally posted by Danilo.

Hello !!

Is the following correct ??

LoadImage() converts all images (.bmp)
automatically to 32 Bit ??
I load images that i saved as 8bit and
24bit .BMP´s, but ImageDepth() returns
32 for every image.

I´m working with ImageList´s and need
to add a new .BMP to the list, so i have
to know the color depth used.

I tried so many things, but it doesnt work.

Anyone knows something about imagelists
and LoadImage() internals ??

Another weird thing:
ImageList_Create returns the same handle
every time i start the program.
Thats weird, because every handle changes
every time, but ImageList_Create returns
1270472 every time i start the application.

I´m really confused...

Thanks,
...Danilo


Edited by - Danilo on 13 January 2002 00:31:21

Author:  BackupUser [ Sun Jan 13, 2002 1:15 am ]
Post subject: 

Restored from previous forum. Originally posted by fred.

LoadImage convert the Image to your desktop color depth. About the image list, it should easy to add loaded BMP to it. What's exactly the problem ?

Fred - AlphaSND

Author:  BackupUser [ Sun Jan 13, 2002 1:59 am ]
Post subject: 

Restored from previous forum. Originally posted by Danilo.

Thanks for the fast answer Fred !!

The ImageList problem is already gone... :)

I need to specify the Color Depth
for the ImageList.
Is there a way to get the color depth
of the desktop with an easy API call ??
(need it in my Toolbar library)

Thanks,
...Danilo
PS: I added Tooltips and more buttons today
to the Toolbar library.
Need to finish the imagelist stuff before
release.... but it looks very good so far... :)

(registered PureBasic user)

Author:  BackupUser [ Sun Jan 13, 2002 2:26 am ]
Post subject: 

Restored from previous forum. Originally posted by Paul.

Quote:
LoadImage convert the Image to your desktop color depth. Fred - AlphaSND



Any way to be able to specify the color depth when loading or saving?
I find the BMP's that it saves are incompatable with Photoshop. I need to save to 24bit but they always save to 32bit (cause my desktop is set to 32bit true color)

Author:  BackupUser [ Sun Jan 13, 2002 2:40 am ]
Post subject: 

Restored from previous forum. Originally posted by fred.

Fixed. Now images are save in 24 bit format. 32 bit is not supported, my fault. I tried and it load in photoshop now. Just tell me if it's fine now. Get the updated lib at http://www.purebasic.com/update/Image

Fred - AlphaSND

Author:  BackupUser [ Sun Jan 13, 2002 2:53 am ]
Post subject: 

Restored from previous forum. Originally posted by Danilo.

1.)
But LoadImage is still using the Desktop depth ??

2.)
Is there a way to get the color depth
of the desktop with an easy API call ??

3.)
How to handle a WM_NOTIFY message in PB ??
(and how do i get the value which button
was pressed ??)

Thanks,
...Danilo

(registered PureBasic user)

Author:  BackupUser [ Sun Jan 13, 2002 5:50 am ]
Post subject: 

Restored from previous forum. Originally posted by Paul.

Awesome Fred !!! Works great!

er.... weren't you going to bed?

Author:  BackupUser [ Sun Jan 13, 2002 9:32 am ]
Post subject: 

Restored from previous forum. Originally posted by fred.

Quote:
Awesome Fred !!! Works great!

er.... weren't you going to bed?


Yes, but some last minutes stuffs to do and I've checked the forums again.. :wink:

Fred - AlphaSND

Author:  BackupUser [ Sun Jan 13, 2002 9:46 am ]
Post subject: 

Restored from previous forum. Originally posted by fred.

1.)
But LoadImage is still using the Desktop depth ??

Yes, LoadImage will always load using desktop depth.

2.)
Is there a way to get the color depth
of the desktop with an easy API call ??

Here is a quick example:

Code:
Structure BITMAP2
   bmType.l
   bmWidth.l
   bmHeight.l
   bmWidthBytes.l
   bmPlanes.w
   bmBitsPixel.w
   bmBits.l
EndStructure

*DC = CreateDC_("DISPLAY", 0, 0, 0)
If *DC
 
  *BMP = CreateCompatibleBitmap_(*DC, 10, 10)
  If *BMP
    GetObject_(*BMP, SizeOf(BITMAP2), Bitmap.BITMAP2)
    MessageRequester("Desktop Depth: ", Str(Bitmap\bmBitsPixel), #MB_ICONINFORMATION)   
    DeleteObject_(*BMP)
  EndIf
 
  DeleteDC_(*DC)
EndIf


3.)
How to handle a WM_NOTIFY message in PB ??
(and how do i get the value which button
was pressed ??)

Use the Callback, it should work.


Fred - AlphaSND

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/