Seite 1 von 1

Image323.dll

Verfasst: 17.05.2006 22:31
von roherter
Ich habe mal angefangen Proceduren zu dieser dll zu schreiben Sie ist Freeware und eigentlich für Libertybasic geschrieben worden mit ihr können u.a. Gif geladen werden genaueres könnt ihr hier nachlesen dort gibt es auch die dll.

http://www.alycesrestaurant.com/dll.htm

Code: Alles auswählen

Global lib.l
Global himage
Procedure InitImage323()
  lib.l=OpenLibrary(#PB_Any,"image323.dll")
EndProcedure
Procedure IMG_Loadimagefile(hwnd,Image$)
  himage=CallFunction(lib.l,"LoadImageFile",hwnd,Image$)
  ProcedureReturn himage
EndProcedure
Procedure IMG_Blur(hbmp,hwnd)
  himage=CallFunction(lib.l,"Blur",hbmp,hwnd)
  ProcedureReturn himage
EndProcedure
Procedure IMG_Negativ(hbmp,hwnd)
  himage=CallFunction(lib.l,"Negative",hbmp,hwnd)
  ProcedureReturn himage
EndProcedure
Procedure IMG_Brightness(hbmp,hwnd,nBright)
  himage=CallFunction(lib.l,"Brightness",hbmp,hwnd,nBright)
  ProcedureReturn himage
EndProcedure
Procedure IMG_DuoTone(hbmp,hwnd,nRed,nGreen,nBlue)
  himage=CallFunction(lib.l,"DuoTone",hbmp,hwnd,nRed,nGreen,nBlue)
  ProcedureReturn himage
EndProcedure
Procedure IMG_Soften(hbmp,hwnd)
  himage = CallFunction(lib.l,"Soften",hbmp,hwnd)
  ProcedureReturn himage 
EndProcedure
Procedure IMG_Bitmapwidth(hbmp)
  bmpwidth = CallFunction(lib.l,"BitmapWidth",hbmp)
  ProcedureReturn bmpwidth
EndProcedure
Procedure IMG_Bitmapheight(hbmp)
  bmpheight = CallFunction(lib.l,"BitmapHeight",hbmp)
  ProcedureReturn bmpheight
EndProcedure
Procedure IMG_ChangeSize(hbmp,hwnd,nWidth,nHeight)
  chsize=CallFunction(lib.l,"ChangeSize",hbmp,hwnd,nWidth,nHeight)
  ProcedureReturn chsize
EndProcedure
  Procedure IMG_Contrast(hbmp,hwnd)
    himage=CallFunction(lib.l,"Contrast",hbmp,hwnd)
    ProcedureReturn himage
 
EndProcedure
    Procedure Freeimage323()
  CloseLibrary(lib.l)
EndProcedure

Verfasst: 18.05.2006 21:37
von roherter
Habe noch ein paar funktionen hinzugefügt s.o.

Verfasst: 18.05.2006 22:20
von ts-soft
Hab da mal nen kleinen Verbesserungsvorschlag, zumindest für PB 4 solltest Du es vielleicht so machen:

Code: Alles auswählen

Prototype.l IMG_Loadimagefile(hWnd.l, Image.s)
Prototype.l IMG_Blur(hBmp.l, hWnd.l)
; ...

Procedure InitImage323()
  Shared image323dll.l
  image323dll.l = OpenLibrary(#PB_Any,"image323.dll")
  If image323dll
    Global IMG_Loadimagefile.IMG_Loadimagefile = GetFunction(image323dll.l, "LoadImageFile")
    Global IMG_Blur.IMG_Blur = GetFunction(image323dll.l, "Blur")
    ; ...
    ProcedureReturn #True
  EndIf
  ProcedureReturn #False
EndProcedure

Procedure Freeimage323()
  Shared image323dll.l
  If image323dll.l
    CloseLibrary(image323dll.l)
    image323dll.l = 0
  EndIf
EndProcedure
nur ergänzen, wo die ... sind :wink:

// edit: fehlende Kommas ergänzt

Verfasst: 18.05.2006 22:24
von roherter
Alles klar wird gemacht wenn ich alle funktionen drin habe stelle ichs wieder hier rein danke für deinen Tip. :allright: