mercury841
10-11-2006, 15:15
Ciao, vorrei ridimensionare l'area video in MHP.
IO faccio in questo modo:
Rectangle source = new Rectangle(0, 0, 720, 576);
Rectangle destination = new Rectangle(360, 0, 720/2, 576/2);
resize(new AWTVideoSize(source, destination));
private void resize(AWTVideoSize size) {
ServiceContextFactory serviceContextFactory = null;
javax.tv.service.selection.ServiceContext serviceContext = null;
try {
serviceContextFactory = ServiceContextFactory.getInstance();
serviceContext = serviceContextFactory.getServiceContext(context);
}//end try
catch (Exception ex) {
ex.printStackTrace();
}//end catch
if (serviceContext != null) {
ServiceContentHandler[] serviceContentHandler = serviceContext.getServiceContentHandlers();
Player player = null;
if (serviceContentHandler.length > 0) {
player = (Player) serviceContentHandler[0];
}//end if
if (player != null) {
AWTVideoSizeControl awtVideoSizeControl = (AWTVideoSizeControl) player.getControl("javax.tv.media.AWTVideoSizeControl");
awtVideoSizeControl.setSize(size);
}//end if
}//end if
}//end method
Con questo codice perņ riesco solo a spostare l'area video in alto a destra senza ridimensionarla. In pratica mi sposta l'area video in alto a destra, perņ il video non viene ridimensionato ma tagliato. Qualcuno potrebbe aiutarmi?
qualsiasi aiuto č ben accetto. Grazie.
IO faccio in questo modo:
Rectangle source = new Rectangle(0, 0, 720, 576);
Rectangle destination = new Rectangle(360, 0, 720/2, 576/2);
resize(new AWTVideoSize(source, destination));
private void resize(AWTVideoSize size) {
ServiceContextFactory serviceContextFactory = null;
javax.tv.service.selection.ServiceContext serviceContext = null;
try {
serviceContextFactory = ServiceContextFactory.getInstance();
serviceContext = serviceContextFactory.getServiceContext(context);
}//end try
catch (Exception ex) {
ex.printStackTrace();
}//end catch
if (serviceContext != null) {
ServiceContentHandler[] serviceContentHandler = serviceContext.getServiceContentHandlers();
Player player = null;
if (serviceContentHandler.length > 0) {
player = (Player) serviceContentHandler[0];
}//end if
if (player != null) {
AWTVideoSizeControl awtVideoSizeControl = (AWTVideoSizeControl) player.getControl("javax.tv.media.AWTVideoSizeControl");
awtVideoSizeControl.setSize(size);
}//end if
}//end if
}//end method
Con questo codice perņ riesco solo a spostare l'area video in alto a destra senza ridimensionarla. In pratica mi sposta l'area video in alto a destra, perņ il video non viene ridimensionato ma tagliato. Qualcuno potrebbe aiutarmi?
qualsiasi aiuto č ben accetto. Grazie.