ExportPicture on Windows is Seriously Limited

With the recent versions of Xojo, access to Quicktime is no longer possible. Nevertheless, Xojo provides a very powerful ExportPicture method under cocoa which provides options for many picture formats. My Mac users are happy with the options which cover all the standard types. I added photoshop separately.

Windows users however appear to be left out in the cold. ExportPicture now only provides BMP picture saves, which is hardly adequate. I have used MBS plugins to provide Tiff and jpeg support, but it is outside the exportPicture save window, which is a complication that few like. Why is ExportPicture so powerful under cocoa and so limited under Windows? Is there an alternative to ExportPicture I should know about that provides the options in the save dialogue?

Whats built in to Cocoa vs whats built in to Windows

Its why, when quicktime was supported on Windows by Apple, it used Quicktime

Norman,

Are you saying the options presented in ExportPicture under cocoa are provided by OSX, and hence we are limited on Windows because the OS does not provide anything comparable? If so, why can Xojo not implement a Windows version of ExportPicture that uses Quicktime, as they did in the past. I realize Apple no longer supports the use of QT in apps, but I want to revert to the old ExportPicture on Windows. Would that be a viable feature request, or is it simply not possible?

Turn on GDI+ to get more image formats on Windows.

[quote=157347:@Robert Birge]Norman,

Are you saying the options presented in ExportPicture under cocoa are provided by OSX, and hence we are limited on Windows because the OS does not provide anything comparable? If so, why can Xojo not implement a Windows version of ExportPicture that uses Quicktime, as they did in the past. I realize Apple no longer supports the use of QT in apps, but I want to revert to the old ExportPicture on Windows. Would that be a viable feature request, or is it simply not possible?[/quote]
Quicktime on Windows is deprecated & unsupported
Using GDI+ there are more available than without GDI+
Enable that and you’ll have more options - but they will vary from what was possible with QuickTime.

[quote]Quicktime on Windows is deprecated & unsupported
Using GDI+ there are more available than without GDI+
Enable that and you’ll have more options - but they will vary from what was possible with QuickTime.[/quote]

Norman,

First of all, I am glad you are not taunting the animals. Peta (but not Sarah Palin) will be impressed.

Second, turning on GDI+ did not solve my problem. However, I am running on Window7 64 bit and Windows 8.1 64bit. Is it possible this only works on the 32bit versions? I thought that GDI+ was automatically included on Windows 8.

I am still using ExportPicture. Do I need to switch to another method to gain access to GDI+ along with a dialogue presenting the options?

When it comes to Windows, I am a newbie. But I have over 100 Windows users (students) and they complain alot.

While I am at it, let me also confirm that all I need to do to turn on GDI+ is to use the switch in the Windows Build Settings Inspector. I have assumed that it does the same thing as setting app.usegdiplus=true inside my application.

ExportPicture should support any of the following (at least here on Windows 7 these all return true as supported export formats)

If Picture.IsExportFormatSupported(Picture.FormatBMP) then break end if If Picture.IsExportFormatSupported(Picture.FormatGIF) then break end if If Picture.IsExportFormatSupported(Picture.FormatJPEG) then break end if If Picture.IsExportFormatSupported(Picture.FormatPNG) then break end if If Picture.IsExportFormatSupported(Picture.FormatTIFF) then break end if

QuickTime support has been removed as a cross platform option since it is deprecated by Apple.
The only way you’d get QuickTime support would be a separate QuickTime plugin for Windows - which we do not provide.
Something like this http://www.monkeybreadsoftware.de/xojo/plugin-quicktime.shtml

Norman,

Thanks for your help and patience.

However, ALL of the above tests yield true in my Windows app, and yet when I execute

  b0 = newpicture(mx,my,32)
  b0.graphics.drawpicture buffer,0,0,mx,my,0,0,nx,ny
  r=ExportPicture(b0)

Only BMP shows as an option on Windows. GDI+ is turned on.

What am I doing wrong?

It would appear you found a bug.

My tests show the same results as you using the examples from the wiki mixed with Norman’s code above.

Either IsExportFormatSupported is broken or ExportPicture is broken.

Today was the first time I used ExportPicture. I have always used the save methods which work for all the formats. I have included an example in the test code below.

[code] Dim p as Picture
Dim r as Boolean
Dim f as FolderItem
f= GetOpenFolderItem(FileTypes1.Jpeg)
If Picture.IsExportFormatSupported(Picture.FormatBMP) then
break
end if
If Picture.IsExportFormatSupported(Picture.FormatGIF) then
break
end if
If Picture.IsExportFormatSupported(Picture.FormatJPEG) then
break
end if
If Picture.IsExportFormatSupported(Picture.FormatPNG) then
break
end if
If Picture.IsExportFormatSupported(Picture.FormatTIFF) then
break
end if
If f <> Nil then
p=Picture.open(f)

' This fails to save anything but BMP on Windows
r=ExportPicture(p)
If r then
  MsgBox "Your picture was saved."
Else
  MsgBox "Your picture was not saved."
End if

' This will work.
dim f1 as FolderItem = GetSaveFolderItem(FileTypes1.Jpeg)
if f1 <> Nil then
  p.Save(f1,Picture.FormatJPEG,Picture.QualityHigh)
end if

End if[/code]

Like Bob, I’ve always used the Picture.Save methods as well, but I’m not creating images, just saving existing images where the type is already known.

I have verified that ExportPicture does not offer the other options on Windows.

Since you guys already have the code, I would recommend that you create a bug report in feedback.

Tim and Bob,

Thanks for confirming the issue. I will create a bug report now.

[quote=157460:@Robert Birge]Norman,

Thanks for your help and patience.

However, ALL of the above tests yield true in my Windows app, and yet when I execute

  b0 = newpicture(mx,my,32)
  b0.graphics.drawpicture buffer,0,0,mx,my,0,0,nx,ny
  r=ExportPicture(b0)

Only BMP shows as an option on Windows. GDI+ is turned on.

What am I doing wrong?[/quote]

From the docs
Windows
The BMP format is supported on Windows. For all other formats, QuickTime is required.

Quicktime no longer being supported BMP is the only option available for this

I noted that I was using ExportPicture in the title of this conversation. And you stated earlier in your responses the following

Now you are saying that ExportPicture will only support multiple formats when QuickTime, now deprecated, is available. What I think you are saying is Xojo can no longer offer a dialogue based picture save on Windows. That is very unfortunate and is something that needs to be fixed. Mac users have it, and Windows users deserve it. If Xojo is truly cross platform then ExportPicture needs to be fixed. To me this is a bug, and others above agree with me.

Norman - are you saying that IsExportFormatSupported is returning bad results? I save PNG and JPG on Windows with no issue reported…

I was writing thinking “Picture.Save” not “ExportPicture”
Picture.Save will let you save in any of the supported formats
ExportPicture doesn’t and I have no idea why it just doesn’t

Thats noted in the docs
ExportPicture has long said “BMP on windows except if you have quicktime installed”
Now quicktime isn’t supported so … “BMP on windows”

Filing an FR to get ExportPicture to support all the formats that Picture.Save does is probably the right thing to ask for

But getting ExportPicture to support all the formats that OS X does is very unlikely since we use OS provided routines & OS X provides many more than Windows does. Its why ExportPicture supported many more with QuickTime than what Windows did natively.

Ah - confusion clears :).

Robert
The case should have been filed as an FR for Windows to support all the same types that Picture.Save does

As written it’s not a bug - its behaving “as designed” but you want the design changed
It will likely never support everything that OS X does - thats just OS differences

37648 - ExportPicture fails on Windows to provide options other than BMP even when GDI+ is loaded

Note. It should not be a feature request. This is a bug. ExportPicture works fine on the Mac under both cocoa and carbon. It has been emasculated on Windows, and needs to be fixed.

Is Xojo cross-platform or not? If so, Xojo needs to provide a picture save window with options, whether it is call ExportPicture or something else. Picture.Save is not the answer.

Quicktime is not supported. Thats where the other formats came from.
The OS doesn’t provide any alternatives except those that exist for Picture.Save which would reasonably expect to be supported.

Xojo provides feature parity where we can but we use OS provided facilities where possible and Windows doesn’t provide them (beyond the formats that Picture.Save provides)
Quicktime did when that was still a supported option
Apple’s not shipped an updated Windows SDK since version 6 or so
It’s basically dead without replacement