Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Native drawing onto a Printer device
Native drawing onto a Printer device [message #442374] Thu, 02 September 2004 13:06 Go to next message
Mark Freiheit is currently offline Mark FreiheitFriend
Messages: 30
Registered: July 2009
Member
I am using a third-party dll to render PDFs.
I can construct a Composite, and provide its
handle through JNI to the native drawing routine,
and it works fine.

However, I am having some difficulty getting
the same results when I construct a GC from
a Printer device. I try to pass the GC's handle
to the native code and get undefined results.

Where the Composite's handle may be cast to an
HWND, I don't think the GC's handle is an HWND.
The reason I think this is that a call to
GetClientRect of the Composite's handle returns
correct values, but on the GC's handle returns
undefined results.

I had the same problem attempting this with a GC
created from an empty Image.

Any thoughts on what the GC's handle should be cast
to on the Windows platform to allow drawing?

Thanks -- Mark
Re: Native drawing onto a Printer device [message #442379 is a reply to message #442374] Thu, 02 September 2004 17:37 Go to previous messageGo to next message
Ivan Markov is currently offline Ivan MarkovFriend
Messages: 61
Registered: July 2009
Member
No.

GC.handle is actually HDC on SWT/Win32, *NOT* HWND.

Does your DLL have alternate method that takes HDC as a parameter, instead
of HWND?
Otherwise, you should investigate if Printer has a handle and what it
represents on SWT/Win32. Maybe Printer's handle will work.

Regards,
Ivan

"Mark Freiheit" <freiheit@speakeasy.net> wrote in message
news:ch75sb$jod$1@eclipse.org...
> I am using a third-party dll to render PDFs.
> I can construct a Composite, and provide its
> handle through JNI to the native drawing routine,
> and it works fine.
>
> However, I am having some difficulty getting
> the same results when I construct a GC from
> a Printer device. I try to pass the GC's handle
> to the native code and get undefined results.
>
> Where the Composite's handle may be cast to an
> HWND, I don't think the GC's handle is an HWND.
> The reason I think this is that a call to
> GetClientRect of the Composite's handle returns
> correct values, but on the GC's handle returns
> undefined results.
>
> I had the same problem attempting this with a GC
> created from an empty Image.
>
> Any thoughts on what the GC's handle should be cast
> to on the Windows platform to allow drawing?
>
> Thanks -- Mark
>
Re: Native drawing onto a Printer device [message #442543 is a reply to message #442379] Tue, 07 September 2004 18:47 Go to previous message
Carolyn MacLeod is currently offline Carolyn MacLeodFriend
Messages: 149
Registered: July 2009
Senior Member
Printer handle is an HDC.
Carolyn

"Ivan Markov" <ivan.markov@wizcom.bg> wrote in message
news:ch7lil$iut$1@eclipse.org...
> No.
>
> GC.handle is actually HDC on SWT/Win32, *NOT* HWND.
>
> Does your DLL have alternate method that takes HDC as a parameter, instead
> of HWND?
> Otherwise, you should investigate if Printer has a handle and what it
> represents on SWT/Win32. Maybe Printer's handle will work.
>
> Regards,
> Ivan
>
> "Mark Freiheit" <freiheit@speakeasy.net> wrote in message
> news:ch75sb$jod$1@eclipse.org...
> > I am using a third-party dll to render PDFs.
> > I can construct a Composite, and provide its
> > handle through JNI to the native drawing routine,
> > and it works fine.
> >
> > However, I am having some difficulty getting
> > the same results when I construct a GC from
> > a Printer device. I try to pass the GC's handle
> > to the native code and get undefined results.
> >
> > Where the Composite's handle may be cast to an
> > HWND, I don't think the GC's handle is an HWND.
> > The reason I think this is that a call to
> > GetClientRect of the Composite's handle returns
> > correct values, but on the GC's handle returns
> > undefined results.
> >
> > I had the same problem attempting this with a GC
> > created from an empty Image.
> >
> > Any thoughts on what the GC's handle should be cast
> > to on the Windows platform to allow drawing?
> >
> > Thanks -- Mark
> >
>
>
Previous Topic:Non-plugin Eclipse project that depends on SWT
Next Topic:Image performance tuning
Goto Forum:
  


Current Time: Fri Apr 26 12:14:26 GMT 2024

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

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

Back to the top