It is currently Mon May 25, 2020 10:44 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject:
PostPosted: Sun Jan 13, 2002 12:25 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 13, 2002 1:15 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 13, 2002 1:59 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 13, 2002 2:26 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 13, 2002 2:40 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 13, 2002 2:53 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 13, 2002 5:50 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
Restored from previous forum. Originally posted by Paul.

Awesome Fred !!! Works great!

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 13, 2002 9:32 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Jan 13, 2002 9:46 am 
Offline
PureBasic Guru
PureBasic Guru

Joined: Tue Apr 22, 2003 7:42 pm
Posts: 16777133
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye