fb:porticula NoPaste
Bilder skalieren (Freeimage.dll)
Uploader: | Volta |
Datum/Zeit: | 28.11.2007 15:43:21 |
#Include Once "FreeImage.bi"
Screen 20,32
Dim As FIBITMAP Ptr Dib
Dim As Integer hoch, breit, Filter, Erg, Flag = 0
Dim As Single faktor
Dib = FreeImage_Load(FIF_PNG, "testtext.png", Flag)
Input "Skalierung ( 0.1 - 10.0 ): ",faktor
If faktor < 0.1 Then faktor = 0.1
If faktor > 10.0 Then faktor = 10.0
breit = Int(FreeImage_GetWidth(Dib)*faktor)
hoch = Int(FreeImage_GetHeight(Dib)*faktor)
?
?"FILTER_BOX = 0"
?"FILTER_BICUBIC = 1"
?"FILTER_BILINEAR = 2"
?"FILTER_BSPLINE = 3"
?"FILTER_CATMULLROM = 4"
?"FILTER_LANCZOS3 = 5"
Input "Filtertyp ( 0 - 5 ): ",Filter
If Filter < 0 Then Filter = 0
If Filter > 5 Then Filter = 5
Dib = FreeImage_Rescale(Dib, breit, hoch, 2)
Erg = FreeImage_Save(FIF_BMP, Dib, "temp_1.bmp", Flag)
FreeImage_Unload(Dib)
BLoad "temp_1.bmp"
Sleep
'Kill "temp_1.bmp" 'wenn gleich gelöscht werden soll