'From Squeak3.3alpha of 12 January 2002 [latest update: #4766] on 20 February 2002 at 3:41:02 pm'! "Change Set: exportJPG-sw Date: 20 February 2002 Author: Scott Wallace Adds option to export via jpeg to the export menu for morphs"! !Form methodsFor: 'fileIn/Out' stamp: 'sw 2/20/2002 15:37'! writeJPEGfileNamed: fileName "Write a JPEG file to the given filename using default settings" self writeJPEGfileNamed: fileName progressive: false " Display writeJPEGfileNamed: 'display.jpeg' Form fromUser writeJPEGfileNamed: 'yourPatch.jpeg' "! ! !Form methodsFor: 'fileIn/Out' stamp: 'sw 2/20/2002 15:29'! writeJPEGfileNamed: fileName progressive: aBoolean "Write a JPEG file to the given filename using default settings. Make it progressive or not, depending on the boolean argument" JPEGReadWriter2 putForm: self quality: -1 "default" progressiveJPEG: aBoolean onFileNamed: fileName " Display writeJPEGfileNamed: 'display.jpeg' progressive: false. Form fromUser writeJPEGfileNamed: 'yourPatch.jpeg' progressive: true "! ! !Morph methodsFor: 'menus' stamp: 'sw 2/20/2002 15:32'! addExportMenuItems: aMenu hand: aHandMorph "Add export items to the menu" aMenu ifNotNil: [ | aSubMenu | aSubMenu _ MenuMorph new defaultTarget: self. aSubMenu add: 'BMP file' action: #exportAsBMP. aSubMenu add: 'GIF file' action: #exportAsGIF. aSubMenu add: 'JPEG file' action: #exportAsJPEG. aMenu add: 'export...' subMenu: aSubMenu] ! ! !Morph methodsFor: 'menus' stamp: 'sw 2/20/2002 15:15'! exportAsJPEG "Export the receiver's image as a JPEG" | fName | fName _ FillInTheBlank request: 'Please enter the name' initialAnswer: self externalName,'.jpeg'. fName isEmpty ifTrue: [^ self]. self imageForm writeJPEGfileNamed: fName! !