请原谅我有点天真,但似乎System.Windows.Controls.DataVisualization.Charting已经从VS2010消失了,并且混合4.我试图制作一个覆盖了线条的条形图,但是甚至不能开始,因为我找不到合适的控件.
我知道我可以使用外部图形包,但我想首先尝试内置控件.
我目前正在定义几个网格如下:
<Grid.RowDefinitions>
<RowDefinition Height="{TemplateBinding Height-Height/5}"/>
<RowDefinition Height="{TemplateBinding Height/15}"/>
<RowDefinition Height="{TemplateBinding Height/20}"/>
<RowDefinition Height="{TemplateBinding Height/6}"/>
</Grid.RowDefinitions>
Run Code Online (Sandbox Code Playgroud)
虽然除法工作正常,但减法不会产生输出.
我也尝试过如下:
<RowDefinition Height="{TemplateBinding Height-(Height/5)}"/>
Run Code Online (Sandbox Code Playgroud)
仍然没有结果.任何建议PLZ.
谢谢,Subhen
**
**现在在我的XAML中,我尝试实现IvalueConverter,如:
<RowDefinition Height="{TemplateBinding Height, Converter={StaticResource heightConverter}}"/>
Run Code Online (Sandbox Code Playgroud)
添加引用为
<local:medieElementHeight x:Key="heightConverter"/>
Run Code Online (Sandbox Code Playgroud)
在旁边的generic.cs我编码如下:
public class medieElementHeight : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
//customVideoControl objVdeoCntrl=new customVideoControl();
double custoMediaElementHeight = (double)value;//objVdeoCntrl.customMediaPlayer.Height;
double mediaElementHeight = custoMediaElementHeight - (custoMediaElementHeight / 5);
return mediaElementHeight;
}
#region IValueConverter Members
object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo …Run Code Online (Sandbox Code Playgroud) 我正在开发一些小部件进入一个库,供我工作的公司内部使用.
我不知道为小部件设置样式的推荐方法是什么.
至少有以下几种方式:
使用Widget.setPrimaryStyleName并让用户提供外部css.我们使用maven原型来构建应用程序,因此我们可以提供默认样式.无论如何我不太喜欢它.
使用GWT 2.0 CssResourceBundle.因此我们可以将CSS编译到模块中并对其进行优化(并且它也可以依赖于浏览器).
提供具有样式的模块.类似于默认的GWT主题.但我不知道这究竟是如何运作的.
我想要:
你对这个主题有什么经验?
注意:如果您正在寻找明确的答案,请查看所有答案和评论.有不同的想法和所有好的想法.然后选择最适合你的:)
我的应用是表示地球上的形状(使用球体就足够了)表面.那些可以是点,线和多边形.应使用度数或弧度来定义坐标(就像地理坐标一样).
球体表面上两点之间的线段应位于其大圆上.多边形应包含这些线的集合.此外,我想在所提到的形状上执行Set - Basic Operations,例如intersection,union,difference,complement.这些操作只需要输出点集合.
我试图通过CGAL的3D球面几何内核和在球体上嵌入的Nef多边形的2D布尔运算来解决这个问题.实际上,我已经遇到了在球体上划线的问题.此外,CGAL在欧几里德空间中工作,它仍然需要几何操作,以便与放置在球体上的大圆一起工作.
我的问题是,如果你可以帮助我实现CGAL中提到的功能,或者你可以推荐另一个C/C++库来实现这一点.非常感谢你!
使用 Mac OS X API,我试图保存一个应用了 Quartz 过滤器的 PDF 文件,就像可以从预览应用程序的“另存为”对话框中一样。到目前为止,我已经编写了以下代码(使用 Python 和 pyObjC,但这对我来说并不重要):
-- filter-pdf.py: 开始
from Foundation import *
from Quartz import *
import objc
page_rect = CGRectMake (0, 0, 612, 792)
fdict = NSDictionary.dictionaryWithContentsOfFile_("/System/Library/Filters/Blue
\ Tone.qfilter")
in_pdf = CGPDFDocumentCreateWithProvider(CGDataProviderCreateWithFilename ("test
.pdf"))
url = CFURLCreateWithFileSystemPath(None, "test_out.pdf", kCFURLPOSIXPathStyle,
False)
c = CGPDFContextCreateWithURL(url, page_rect, fdict)
np = CGPDFDocumentGetNumberOfPages(in_pdf)
for ip in range (1, np+1):
page = CGPDFDocumentGetPage(in_pdf, ip)
r = CGPDFPageGetBoxRect(page, kCGPDFMediaBox)
CGContextBeginPage(c, r)
CGContextDrawPDFPage(c, page)
CGContextEndPage(c)
Run Code Online (Sandbox Code Playgroud)
-- filter-pdf.py: 结束
不幸的是,没有应用过滤器“蓝色色调”,输出 PDF …
gcc 4.4.1
我正在使用read函数读入wave文件.但是,当它进入读取功能时.执行似乎停止并冻结.我想知道我是否做错了.
文件大小test-short.wave是:514K.
我的目标是一次将文件读入内存缓冲区块.目前我只测试这个.
非常感谢任何建议,
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
int main(void)
{
char buff = malloc(10240);
int32_t fd = 0;
int32_t bytes_read = 0;
char *filename = "test-short.wav";
/* open wave file */
if((fd = (open(filename, O_RDWR)) == -1))
{
fprintf(stderr, "open [ %s ]\n", strerror(errno));
return 1;
}
printf("Opened file [ %s ]\n", filename);
printf("sizeof(buff) [ %d ]\n", sizeof(buff));
bytes_read = read(fd, buff, sizeof(buff));
printf("Bytes read [ %d ]\n", bytes_read); …Run Code Online (Sandbox Code Playgroud) 我使用以下代码从手机或SDCard中检索图像,然后将该图像用于我的ListField.它提供输出,但生成屏幕需要很长时间.如何解决这个问题呢 ??谁能帮我??提前致谢!!!
String text = fileholder.getFileName();
try{
String path="file:///"+fileholder.getPath()+text;
//path=”file:///SDCard/BlackBerry/pictures/image.bmp”
InputStream inputStream = null;
//Get File Connection
FileConnection fileConnection = (FileConnection) Connector.open(path);
inputStream = fileConnection.openInputStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int j = 0;
while((j=inputStream.read()) != -1) {
baos.write(j);
}
byte data[] = baos.toByteArray();
inputStream.close();
fileConnection.close();
//Encode and Resize image
EncodedImage eImage = EncodedImage.createEncodedImage(data,0,data.length);
int scaleFactorX = Fixed32.div(Fixed32.toFP(eImage.getWidth()),
Fixed32.toFP(180));
int scaleFactorY = Fixed32.div(Fixed32.toFP(eImage.getHeight()),
Fixed32.toFP(180));
eImage=eImage.scaleImage32(scaleFactorX, scaleFactorY);
Bitmap bitmapImage = eImage.getBitmap();
graphics.drawBitmap(0, y+1, 40, 40,bitmapImage, 0, 0);
graphics.drawText(text, 25, y,0,width);
} …Run Code Online (Sandbox Code Playgroud) 我有一个像这样的字符串:
<span style="font-weight: bold;">Foo</span>
Run Code Online (Sandbox Code Playgroud)
我想用PHP来制作它
<strong>Foo</strong>
Run Code Online (Sandbox Code Playgroud)
...而不影响其他人span.
我怎样才能做到这一点?
我发现方法的java.lang.Integer实现compareTo如下:
public int compareTo(Integer anotherInteger) {
int thisVal = this.value;
int anotherVal = anotherInteger.value;
return (thisVal<anotherVal ? -1 : (thisVal==anotherVal ? 0 : 1));
}
Run Code Online (Sandbox Code Playgroud)
问题是为什么使用比较而不是减法:
return thisVal - anotherVal;
Run Code Online (Sandbox Code Playgroud) 我在部署Visio插件时遇到了一些问题.运行VSTO文件在我的计算机上运行,但每当我尝试将其移动到任何其他用户的计算机时,它会在部署时抛出错误.我认为这可能是我在项目属性中设置的设置,所以我创建了一个全新的插件项目并将其设置为在启动时显示一个消息框.我得到的错误是:
自定义安装期间发生错误.
在XML中找不到预期的元素"addIn".

c ×2
java ×2
wpf ×2
.net-4.0 ×1
blackberry ×1
c#-4.0 ×1
c++ ×1
cgal ×1
charts ×1
comparison ×1
css ×1
file-io ×1
geometry ×1
graphics ×1
gwt ×1
image ×1
integer ×1
macos ×1
ms-office ×1
optimization ×1
overflow ×1
php ×1
preg-replace ×1
pyobjc ×1
regex ×1
silverlight ×1
visio ×1
vsto ×1
widget ×1
xaml ×1