如何使用SCILAB将背景图像放入图中?

问题描述 投票:1回答:2

在图表的列表中的scilab中没有显示设置背景图像的选项。我很感激有这样做过的人请指导我这样做。

scilab
2个回答
1
投票

Scilab的新版本实际上有image style用于uncontrol物体。例如,参见Trity Technologies Sdn Bhd和Chin Luh Tan的this sample。基本上以最简单的形式:

f = figure();
h = uicontrol(f, 'style', 'image', 'string',...
    get_absolute_file_path('foo.sce') + 'bar.png')

其中foo.sce是您脚本的名称,bar.png应该替换为您要显示的图像的相对地址。


0
投票

我不知道“内置”方式,但您可以安装图像处理工具箱。之后,您可以阅读,处理和显示图像。如果你在图像上“绘制”一些东西,它就变成了背景图像:)

global IPD_PATH;
RGB=ReadImage(IPD_PATH+"demos\teaset.png");
//you can also call it with absolute path e.g.: "d:\pics\mypic.jpg"

scf(0);
ShowColorImage(RGB,"Color Image in the background");
//to see these axes set them visible (turned off by default in ShowColorImage)
//c=gca(); c.axes_visible=["on","on","off"];

a=newaxes();  //to use new axes, otherwise your axes go from 0 to the picture size in pixels
a.filled="off";   //to make it transparent

X=1:0.1:10;   //some arbitrary data to plot
plot2d(X,sin(X));
//since you dont know the index of the red colour in the current RGB color map, it's easier to do like this:
e=gce(); e.children.foreground=color("red");  
plot2d(X,cos(X));
e=gce(); e.children.foreground=color("blue");
© www.soinside.com 2019 - 2024. All rights reserved.