Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [Draw2D] change icon of Label depending on Zoom(does this make sense?)
[Draw2D] change icon of Label depending on Zoom [message #754737] Fri, 04 November 2011 06:27 Go to next message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
Hello,

i wonder if it makes sense to change the image used by labels depending on zoom level.
i ask this as i have pretty large images in use:

1x ~5500x4000px
100-1000 of 128x128px

so when you zoom out i would use low res images of 64x64, 32x32 otherwise the high res 128x128

how can i achieve this, without a lot of struggle?
note: i already looked at the zoom example and noticed that icons get blocky if you zoom in a lot, while text keeps sharp
Re: [Draw2D] change icon of Label depending on Zoom [message #755567 is a reply to message #754737] Tue, 08 November 2011 19:55 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
Well, I haven't tried yet, but I suppose the easiest approach would be to query the ZoomManager (obtainable from ScalabeRootEditPart) for the current zoom level from within your GraphicalEditPart#refreshVisuals() implementation and to update your label base on this.
Re: [Draw2D] change icon of Label depending on Zoom [message #755646 is a reply to message #755567] Wed, 09 November 2011 08:26 Go to previous message
Ludwig Moser is currently offline Ludwig MoserFriend
Messages: 476
Registered: July 2009
Senior Member
Alexander y wrote on Tue, 08 November 2011 14:55
Well, I haven't tried yet, but I suppose the easiest approach would be to query the ZoomManager (obtainable from ScalabeRootEditPart) for the current zoom level from within your GraphicalEditPart#refreshVisuals() implementation and to update your label base on this.

i'm confused now.
i implemented the zoom stuff with a SWT scroll component
i further have a LWS, the IFigure=content and a ZoomContainer

for me the zoom level is easily available, so thats no problem
but where do i get that graphicaleditpart?
Previous Topic:ScrollableThumbnail Nullpointer
Next Topic:Gef Connections getting the center of the of the rectangle edge
Goto Forum:
  


Current Time: Thu Apr 25 08:07:17 GMT 2024

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

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

Back to the top