Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problems printing images
Problems printing images [message #134571] Thu, 27 May 2004 10:00 Go to next message
Jose M Beleta is currently offline Jose M BeletaFriend
Messages: 70
Registered: July 2009
Member
If I create an Image from a file that has a transparency bit greater than
zero thru an ImageDescriptor the following code in
ImageDescriptor#createImage(boolean returnMissingImageOnError, Device
device) gets called by default:

public Image createImage(boolean returnMissingImageOnError, Device device) {
....
....
try {
if (data.transparentPixel >= 0) {
ImageData maskData = data.getTransparencyMask();
return new Image(device, data, maskData);
}
return new Image(device, data);
} catch (SWTException exception) {
....
}
}

The image returned is that created using "Image(device, data, maskData)"
constructor. In this case the image does not get printed when using the
default printing action.

If I create the image using:

new Image(device, data);

the image is printed but with the transparency pixels as black pixels.

In both cases the images show correctly on the screen with the transparency
properly set.

Any hint?

Jose M Beleta
Re: Problems printing images [message #135220 is a reply to message #134571] Tue, 01 June 2004 00:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

It's fixed!

https://bugs.eclipse.org/bugs/show_bug.cgi?id=28766

"Jose M Beleta" <beleta@attglobal.net> wrote in message
news:c94dqe$1nv$1@eclipse.org...
> If I create an Image from a file that has a transparency bit greater than
> zero thru an ImageDescriptor the following code in
> ImageDescriptor#createImage(boolean returnMissingImageOnError, Device
> device) gets called by default:
>
> public Image createImage(boolean returnMissingImageOnError, Device device)
{
> ...
> ...
> try {
> if (data.transparentPixel >= 0) {
> ImageData maskData = data.getTransparencyMask();
> return new Image(device, data, maskData);
> }
> return new Image(device, data);
> } catch (SWTException exception) {
> ...
> }
> }
>
> The image returned is that created using "Image(device, data, maskData)"
> constructor. In this case the image does not get printed when using the
> default printing action.
>
> If I create the image using:
>
> new Image(device, data);
>
> the image is printed but with the transparency pixels as black pixels.
>
> In both cases the images show correctly on the screen with the
transparency
> properly set.
>
> Any hint?
>
> Jose M Beleta
>
>
Re: Problems printing images [message #136441 is a reply to message #135220] Sat, 05 June 2004 15:29 Go to previous messageGo to next message
Jose M Beleta is currently offline Jose M BeletaFriend
Messages: 70
Registered: July 2009
Member
I have just tested it, and it does not work. It prints instead of the icon a
small figure, that I cannot identify but perhaps it is a small view of it.

Jose M Beleta

"Randy Hudson" <none@us.ibm.com> escribi
Re: Problems printing images [message #136452 is a reply to message #135220] Sat, 05 June 2004 18:11 Go to previous messageGo to next message
Jose M Beleta is currently offline Jose M BeletaFriend
Messages: 70
Registered: July 2009
Member
These are examples of printing. They are printed using Acrobat.

Jose

"Randy Hudson" <none@us.ibm.com> escribi
Re: Problems printing images [message #136861 is a reply to message #136452] Mon, 07 June 2004 20:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This looks really bad. Please try to reduce this to the smallest amount of
code possible, and open a bugzilla with "regression" in the title.
Hopefully, you can create an SWT-only test case by creating your own Printer
device and drawing the Image straight to the printer.

"Jose M Beleta" <beleta@attglobal.net> wrote in message
news:c9t1t2$9u0$1@eclipse.org...
> These are examples of printing. They are printed using Acrobat.
>
> Jose
>
> "Randy Hudson" <none@us.ibm.com> escribi
Re: Problems printing images [message #143324 is a reply to message #136861] Mon, 19 July 2004 15:58 Go to previous message
Eclipse UserFriend
Originally posted by: markp.softlanding.com

Has anything come of this problem? I never saw where a new bugzilla
was created.

We have moved to GEF 3.0 and want to use the built-in printing support
to print our diagrams. It all works great except that any GIF's on the
diagram print as a small black dot as shown in the PDF's posted in an
earlier message by someone else in this thread. Are there any
workarounds? Could we use another image format like PNG?

By "built-in" printing I mean that we are just using your PrintAction
class with no subclassing, and other than this problem it all works
great, much better than 2.1.

Mark

Randy Hudson wrote:

> This looks really bad. Please try to reduce this to the smallest
> amount of code possible, and open a bugzilla with "regression" in the
> title. Hopefully, you can create an SWT-only test case by creating
> your own Printer device and drawing the Image straight to the printer.
>
> "Jose M Beleta" <beleta@attglobal.net> wrote in message
> news:c9t1t2$9u0$1@eclipse.org...
> > These are examples of printing. They are printed using Acrobat.
> >
> > Jose
> >
> > "Randy Hudson" <none@us.ibm.com> escribis en el mensaje
> > news:c9gjnt$7p0$1@eclipse.org...
> > > It's fixed!
> > >
> > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=28766
> > >
> > > "Jose M Beleta" <beleta@attglobal.net> wrote in message
> > > news:c94dqe$1nv$1@eclipse.org...
> > > > If I create an Image from a file that has a transparency bit
> > > > greater
> > than
> > > > zero thru an ImageDescriptor the following code in
> > > > ImageDescriptor#createImage(boolean returnMissingImageOnError,
> > > > Device device) gets called by default:
> > > >
> > > > public Image createImage(boolean returnMissingImageOnError,
> > > > Device
> > device)
> > > {
> > > > ...
> > > > ...
> > > > try {
> > > > if (data.transparentPixel >= 0) {
> > > > ImageData maskData = data.getTransparencyMask();
> > > > return new Image(device, data, maskData);
> > > > }
> > > > return new Image(device, data);
> > > > } catch (SWTException exception) {
> > > > ...
> > > > }
> > > > }
> > > >
> > > > The image returned is that created using "Image(device, data,
> maskData)"
> > > > constructor. In this case the image does not get printed when
> > > > using
> the
> > > > default printing action.
> > > >
> > > > If I create the image using:
> > > >
> > > > new Image(device, data);
> > > >
> > > > the image is printed but with the transparency pixels as black
> > > > pixels.
> > > >
> > > > In both cases the images show correctly on the screen with the
> > > transparency
> > > > properly set.
> > > >
> > > > Any hint?
> > > >
> > > > Jose M Beleta
> > > >
> > > >
> > >
> > >
> >
> >
> >
Previous Topic:Eclipse Plugin Application using GEF
Next Topic:Problem about getAdapter() method
Goto Forum:
  


Current Time: Thu Apr 25 19:18:56 GMT 2024

Powered by FUDForum. Page generated in 0.03454 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top