Code: Select all
CreateImage(2,256,192)
LoadImage(2,filename$)
StartDrawing(WindowOutput())
ResizeImage(2,256,192)
DrawImage(UseImage(2),0,0)
StopDrawing()
Code: Select all
CreateImage(2,256,192)
LoadImage(2,filename$)
StartDrawing(WindowOutput())
ResizeImage(2,256,192)
DrawImage(UseImage(2),0,0)
StopDrawing()

Code: Select all
If LoadImage(0, Filename$)
ResizeWidth.f = GadgetWidth(0) / ImageWidth()
ResizeHeight.f = GadgetHeight(0) / ImageHeight()
ResizePercent.f = ResizeHeight
If ResizeWidth < ResizeHeight
ResizePercent = ResizeWidth
EndIf
ResizeImage(0, ImageWidth()*ResizePercent, ImageHeight()*ResizePercent)
ResizeGadget(0,((WindowWidth()-ImageWidth())/2), ((WindowHeight()-ImageHeight())/2),ImageWidth(), ImageHeight())
SetGadgetState(0, ImageID()) ; Change the picture in the gadget
...


LCD wrote:Looks like Im talking with a expert.
Actually, when I use PB to save jpgs, I usually have much smaller filesThe JPEG format uses destructive compression (lossy) which means that the picture loses more or less of its original information when it's compressed. This is actually one of the best lossy compression algorithms available, which can dramatically decrease the image size without lots of visible artifacts.
No need to answer this question anymore, as I found the GrabImage() function.Is there a possibility to copy a part of a image() to another image()?

I have image conversion included too, but at the moment I have notLCD wrote:I see, my program is a image converter... snip....
Code: Select all
; --------------------------------------------------------------------------
; Subroutine to display selected images
; --------------------------------------------------------------------------
DisplayImage:
HideGadget(0,1) ; Hide the Image Gadget
If ClickNext.w ; Is it in manual mode?
ResizeGadget(0, 10, 30, WindowWidth()-20, WindowHeight()-92)
HideGadget(10,0) ; Show Next Button
Else
ResizeGadget(0, 10, 30, WindowWidth()-20, WindowHeight()-62)
EndIf
If Filename$ ; Must have a file name
If LoadImage(0, Filename$) ; Load the image file
ResizeWidth.f = GadgetWidth(0) / ImageWidth() ; Calc resize width %
ResizeHeight.f = GadgetHeight(0) / ImageHeight(); Calc resize height %
ResizePercent.f = ResizeHeight ; Then choose smaller
If ResizeWidth < ResizeHeight
ResizePercent = ResizeWidth
EndIf
ResizeImage(0, ImageWidth()*ResizePercent, ImageHeight()*ResizePercent)
ResizeGadget(0,((WindowWidth()-ImageWidth())/2), ((WindowHeight()-ImageHeight())/2),ImageWidth(), ImageHeight())
SetGadgetState(0, ImageID()) ; Change the picture in the gadget
HideGadget(0,0) ; Unhide the Image Gadget
; Ability to save the file may be disabled by
; uncommenting the Next two lines
; DisableToolBarButton(3, 1) ; Disable the save button
; DisableMenuItem(3, 1) ; Disable the save menu
EndIf
If ClickNext.w ; If in manual mode
HideGadget(10,0) ; Show Next Button
EndIf
EndIf
Return
; --------------------------------------------------------------------------
; End of the Display Image routine
; --------------------------------------------------------------------------