本文整理汇总了C#中Frame.Deserialize方法的典型用法代码示例。如果您正苦于以下问题:C# Frame.Deserialize方法的具体用法?C# Frame.Deserialize怎么用?C# Frame.Deserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Frame
的用法示例。
在下文中一共展示了Frame.Deserialize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFrames
public List<Frame> GetFrames()
{
List<Frame> frames = new List<Frame>();
for (int i = 0; i < frames_.Count; ++i) {
Frame frame = new Frame();
frame.Deserialize(frames_[i]);
frames.Add(frame);
}
return frames;
}
示例2: Frame
public Frame Frame()
{
if ( stream.Position == stream.Length ) {
stream.Seek( 0, SeekOrigin.Begin );
}
// データ長
var length = new byte[4];
stream.Read( length, 0, length.Length );
// Frameデータ
var binary = new byte[BitConverter.ToUInt32( length, 0 )];
stream.Read( binary, 0, binary.Length );
// デシリアライズ
var frame = new Frame();
frame.Deserialize( binary );
return frame;
}
示例3: NextFrame
/** Advances the playhead, deserializes the frame, and returns it.*/
public Frame NextFrame() {
current_frame_ = new Frame();
if (frames_.Count > 0) {
if (frame_index_ >= frames_.Count && loop) {
frame_index_ -= frames_.Count;
} else if (frame_index_ < 0 && loop) {
frame_index_ += frames_.Count;
}
if (frame_index_ < frames_.Count && frame_index_ >= 0) {
current_frame_.Deserialize(frames_[(int)frame_index_]);
frame_index_ += speed;
}
}
return current_frame_;
}
示例4: LoadListListFrame
public static List<List<Frame>> LoadListListFrame(string path)
{
List<List<Frame>> listListF = new List<List<Frame>>();
Stream readStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
IFormatter formatter = new BinaryFormatter();
List<List<byte[]>> listListB = (List<List<byte[]>>)formatter.Deserialize(readStream);
readStream.Close();
Controller control = new Controller();
for (int i = 0; i < listListB.Count; i++)
{
List<Frame> listF = new List<Frame>();
for (int j = 0; j < listListB[i].Count; j++)
{
Frame f = new Frame();
f.Deserialize(listListB[i][j]);
listF.Add(f);
}
listListF.Add(listF);
}
control.Dispose();
return listListF;
}
示例5: LoadFrame
public static Frame LoadFrame(string path)
{
byte[] frameData = System.IO.File.ReadAllBytes(path);
Controller control = new Controller();
Frame f = new Frame();
f.Deserialize(frameData);
control.Dispose();
return f;
}