我有一个byte[]存储我的图像.
现在我希望能够扩展它并将其存储在另一个中byte[].
我知道如何扩展Bitmaps,并可以将我转换byte[]为Bitmap.但是我不能将缩放的Bitmap重新变成一个byte[].
黑莓
EncodedImage thumbnail = image.scaleImageToFill(50, 50);什么都不做.
我试图创建一个50x50的缩略图.不一定要准确.它存储在byte []中.
如何调整存储在byte []中的图像的大小,并将其保存在新的byte []中.
byte[] imageTaken;
//Create thumbnail from image taken
EncodedImage image = EncodedImage.createEncodedImage(imageTaken, 0, -1);
image.getBitmap();
EncodedImage thumbnail = image.scaleImageToFill(50, 50);
byte[] thumbArray = thumbnail.getData();
Run Code Online (Sandbox Code Playgroud) 我为我的SOAP端点工作了SSL.
但是一旦我启用了我的REST端点,它就会抛出一个拟合:
Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].
Run Code Online (Sandbox Code Playgroud)
我的app.config:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="IIncreasedBufferSize" maxBufferSize="1024000"
maxReceivedMessageSize="1024000">
<readerQuotas maxArrayLength="1024000" />
<security mode ="Transport">
<transport clientCredentialType= "None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="WCFBehaviourSSL"
name="IWCF.IService">
<endpoint name="soap" address="soap" binding="basicHttpBinding" bindingConfiguration="IIncreasedBufferSize"
contract="IWCF.IServices">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint name="rest"
address="rest"
binding="webHttpBinding"
contract="IWCF.IServices"
behaviorConfiguration="REST" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/WcfServiceLibrary2/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors> …Run Code Online (Sandbox Code Playgroud) 所以基本上给出了以下代码.
何时action = 2;和mode = 1将i被设置为2?
我正在研究同事代码,它是这样编写的,但我认为中断只会跳过if并继续其余部分case 2.所以基本上if语句是没有意义的.
switch(action){
case 1: i = 1; break;
case 2: if(mode == 1)
{
break;
}
i = 2;
break;
case 3: i = 3; break;
Run Code Online (Sandbox Code Playgroud)
我把它重写为:
case 2: if(mode != 1)
i = 2;
break;
Run Code Online (Sandbox Code Playgroud)
但它不是唯一的地方,有些更复杂.如果我要重构它,我需要一些我正确的信息.
我试图在未登录时拒绝访问文件夹或资源(防止泄漏).在文件夹中,我有我的
Web.config :(/Media)
<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<deny users="?"/>
<allow users="*" />
</authorization>
</system.web>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我打电话的代码:
指数:
@Video.MediaPlayer(
path: "~/Media/Tree Felling2.wmv",
width: "600",
height: "400",
autoStart: false,
playCount: 1,
uiMode: "full",
stretchToFit: true,
enableContextMenu: true,
mute: false,
volume: 75)
@Video.Flash(path: "~/Media/sample.swf",
width: "80%",
//height: "600",
play: true,
loop: false,
menu: true,
bgColor: "red",
quality: "medium",
//scale: "showall",
windowMode: "transparent")
Run Code Online (Sandbox Code Playgroud)
注销时:不显示闪存.媒体播放器不会连接到媒体.(预期)
登录后:显示 flash.但媒体播放器仍然无法连接到媒体.
我哪里错了?..
我试图比较一个来自R.string类的简单字符串但是有些错误.
if(this.b1.getText().equals(R.string.stop_track))
Run Code Online (Sandbox Code Playgroud)
b1文本等于stop_track文本,为什么我得到错误的结果?
这来自我们老师给我们的一个单词库,我应该返回最长的单词,其中只包含键盘顶行的字符.目前它返回空白.请帮忙.
//What's the longest word only using the top row of the keyboard?
public static void Question6() {
String longestWordSoFar = " ";
System.out.println("Question 6:");
for(int i = 1; i < WordList.numWords(); i++) // check every word in wordlist
{
if(topRow(WordList.word(i))) { // if the length is greater than the previous word, replace it
{
if(WordList.word(i).length() > longestWordSoFar.length())
longestWordSoFar=WordList.word(i);
}
}
}
System.out.println("longest word including top row: " + longestWordSoFar);
System.out.println();
return;
}
public static boolean topRow(String word) {
for(int …Run Code Online (Sandbox Code Playgroud) java ×3
android ×1
asp.net ×1
asp.net-mvc ×1
blackberry ×1
break ×1
c# ×1
case ×1
endpoint ×1
if-statement ×1
image ×1
java-me ×1
media ×1
rest ×1
ssl ×1