Page 1 of 1

Posted: Thu Mar 06, 2003 10:15 pm
by BackupUser
Restored from previous forum. Originally posted by Inner.

SDK Can be found here: http://www.xnview.com/
My Source Code: http://www.inet.net.nz/~tjr/irc/xnview/xnviewpb.zip

I've mannaged to convert 90% of it I hope, it even loads bitmaps and gets information, the part I am stuck at is the actual displaying of the bitmap in the window, this would open up 381 image formats to be displayed pb if I could work out how to draw the image in the window :)

Thanks for any help.

Posted: Fri Mar 07, 2003 6:21 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.

When you have a Windows-Bitmap-id

Try this:

Code: Select all

result=CreateImage(0,width,height)
StartDrawing(ImageOutput())
DrawImage(bitmap,0,0)
StopDrawing()
if you want to get the width and height:

Code: Select all

Procedure FreeImage_GetBitmapWidth(hBITMAP)
  bmpinfo.bitmap
  ;  Validate parameters
  If hBITMAP = 0 : ProcedureReturn 0 : EndIf
  If GetObjectType_(hBITMAP)  #OBJ_BITMAP : ProcedureReturn 0 : EndIf
   
  ;  Get the information for the bitmap
  If GetObject_(hBITMAP, 4+4+4+4+2+2+4, BmpInfo) = 0 : ProcedureReturn 0 : EndIf
  ProcedureReturn BmpInfo\bmWidth
EndProcedure
Procedure FreeImage_GetBitmapHeight(hBITMAP)
  BmpInfo.BITMAP
  
  ;  Validate parameters
  If hBITMAP = 0 : ProcedureReturn 0 : EndIf
  If GetObjectType_(hBITMAP)  #OBJ_BITMAP : ProcedureReturn 0 : EndIf
    
  ;  Get the information for the bitmap
  If GetObject_(hBITMAP, 4+4+4+4+2+2+4, BmpInfo) = 0 : ProcedureReturn 0 : EndIf
  ProcedureReturn BmpInfo\bmHeight
EndProcedure
PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Fri Mar 07, 2003 7:31 pm
by BackupUser
Restored from previous forum. Originally posted by GPI.

Look at the other lib*.bas

you must convert all of them. in every lib are new function.

so a convertBitmapToDIB (or something like this) conversion.

You have the problem, that you get from the load-routine not a handle of a bitmap, you get a adress of a structure. you must convert this structure into a dib. Then you can try it.

GPI

PII 333, 256MB, Asus TNT2Ultra 32MB, AWE Gold 64 4MB

Posted: Fri Mar 07, 2003 10:36 pm
by BackupUser
Restored from previous forum. Originally posted by Inner.

A-haaa thank you :)