本文整理汇总了C#中Picture类的典型用法代码示例。如果您正苦于以下问题:C# Picture类的具体用法?C# Picture怎么用?C# Picture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Picture类属于命名空间,在下文中一共展示了Picture类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetPictureWithBitmap
public override DBlog.Tools.Web.PicturePage.Picture GetPictureWithBitmap(int id)
{
Picture pic = new Picture();
TransitImage img = SessionManager.GetCachedObject<TransitImage>(
"GetImageWithBitmapById", SessionManager.PostTicket, id);
if (img == null)
return null;
if (img.Data == null && !string.IsNullOrEmpty(img.Path))
{
img.Data = new ThumbnailBitmap(Path.Combine(Path.Combine(
SessionManager.GetSetting("Images", string.Empty),
img.Path), img.Name)).Bitmap;
}
pic.Bitmap = img.Data;
pic.Created = pic.Modified = img.Modified;
pic.Name = img.Name;
pic.Id = img.Id;
if (SessionManager.CountersEnabled)
{
IncrementCounter();
}
return pic;
}
开发者ID:dblock,项目名称:dblog,代码行数:29,代码来源:ShowPicture.aspx.cs
示例2: ReadAsDecimal
public static decimal? ReadAsDecimal(this Queue<EdiEntry> queue, string path, Picture? picture, char? decimalMark) {
var text = ReadAsString(queue, path);
if (string.IsNullOrEmpty(text))
return null;
return text.Parse(picture, decimalMark);
}
开发者ID:indice-co,项目名称:EDI.Net,代码行数:7,代码来源:EdiReadQueue.cs
示例3: AddComment
public void AddComment(AddCommentInput input)
{
if (input != null)
{
var comment = new Comment
{
Text = input.Text
};
if (input.UserId.HasValue)
{
var user = new User
{
Id = input.UserId.Value
};
comment.AssignedUser = user;
}
if (input.PictureId.HasValue)
{
var picture = new Picture
{
Id = input.PictureId.Value
};
comment.AssignedPicture = picture;
}
_commentRepository.Insert(comment);
}
}
开发者ID:z0mbieD,项目名称:pictureManager,代码行数:32,代码来源:CommentAppService.cs
示例4: PreviewGrid
public PreviewGrid(Picture picture)
: base()
{
_displayPicture = picture;
_viewPort = new ViewportControl();
this.Children.Add(_viewPort);
_viewPort.ManipulationStarted += OnViewportManipulationStarted;
_viewPort.ManipulationDelta += OnViewportManipulationDelta;
_viewPort.ManipulationCompleted += OnViewportManipulationCompleted;
_viewPort.ViewportChanged += OnViewportChanged;
ImageLoaded = false;
_imageView = new Image();
_bitmap = new BitmapImage();
//_bitmap.SetSource(picture.GetImage());
_imageView.Source = _bitmap;
_imageView.Stretch = Stretch.Uniform;
_imageView.RenderTransformOrigin = new Point(0, 0);
_scaleTransform = new ScaleTransform();
_imageView.RenderTransform = _scaleTransform;
_imageHolderCanvas = new Canvas();
_imageHolderCanvas.Children.Add(_imageView);
_viewPort.Content = _imageHolderCanvas;
//LoadImage();
}
开发者ID:KayNag,项目名称:LumiaImagingSDKSample,代码行数:31,代码来源:PreviewGrid.cs
示例5: FindChessBoardCorners
private PointF[] FindChessBoardCorners(Picture picture, string uniqueSourceId)
{
using (var gray = picture.Bgra.Convert<Gray, byte>())
{
PointF[] corners;
var ok = CameraCalibration.FindChessboardCorners(gray, this.Dim, CALIB_CB_TYPE.ADAPTIVE_THRESH | CALIB_CB_TYPE.FILTER_QUADS | CALIB_CB_TYPE.NORMALIZE_IMAGE, out corners);
foreach (var c in corners)
if (float.IsNaN(c.X) || float.IsNaN(c.Y))
ok = false;
if (ok)
{
var window = new Size(15, 15);
var zeroZone = new Size(-1, -1);
var criteria = new MCvTermCriteria(16, 0.001);
gray.FindCornerSubPix(new PointF[][] { corners }, window, zeroZone, criteria);
picture.Bgra.ConvertFrom(gray);
return corners;
}
}
return null;
}
开发者ID:JaapSuter,项目名称:Pentacorn,代码行数:25,代码来源:Chessboard.cs
示例6: ShowPicture
public void ShowPicture(Picture picture)
{
lock (this)
{
m_Picture = picture;
if (m_Picture != null)
{
m_TextBlockDQId.Text = m_Picture.LayerId.ToString();
m_TextBlockPictureNumber.Text = m_Picture.Index.ToString();
m_TextBlockSize.Text = String.Format("{0}x{1}", m_Picture.Width, m_Picture.Height);
m_TextBlockNumberOfSlices.Text = m_Picture.NumberOfSlices.ToString();
m_EntropyCodingType.Text = m_Picture.EntropyCodingType;
m_TextBlockMbBitsCount.Text = (m_Picture as H264Picture).MbBitsCount.ToString();
m_TextBlockMD5.Text = String.Format("Y\t= {0}\nU\t= {1}\nV\t= {2}\nYUV\t= {3}",
m_Picture.GetMd5(Utils.MD5_ELTMB_TYPE, 0),
m_Picture.GetMd5(Utils.MD5_ELTMB_TYPE, 1),
m_Picture.GetMd5(Utils.MD5_ELTMB_TYPE, 2),
m_Picture.GetMd5(Utils.MD5_ELTMB_TYPE, 3)).ToUpper();
}
else
{
// FIXME: show error image
Debug.Assert(false);
}
}
}
开发者ID:sarandogou,项目名称:thialgou,代码行数:26,代码来源:ScreenPictureInfo.xaml.cs
示例7: Respond
/*
* Responder stuff
*/
/// <summary>
/// Updates the data with which the web event responds and sets the correct MIME type.
/// </summary>
/// <param name="picture">Picture to be published. </param>
public void Respond(Picture picture)
{
if (CheckResponded()) return;
if (picture != null)
{
string tempMimeType = "application/binary";
if (picture.Encoding == Picture.PictureEncoding.BMP)
{
tempMimeType = "image/bmp";
}
else if (picture.Encoding == Picture.PictureEncoding.GIF)
{
tempMimeType = "image/gif";
}
else if (picture.Encoding == Picture.PictureEncoding.JPEG)
{
tempMimeType = "image/jpeg";
}
webEvent.ContentType = tempMimeType;
webEvent.ResponseData = picture.PictureData;
}
SendResponse();
}
开发者ID:EmiiFont,项目名称:MyShuttle_RC,代码行数:33,代码来源:Responder.cs
示例8: SetTextMesh
public void SetTextMesh(Picture script)
{
textToChange = script.text;
simpleText = script.simpleText;
picture = script;
rowLimit = 2;
}
开发者ID:Jonanory,项目名称:Reputations,代码行数:7,代码来源:TextChanger.cs
示例9: ListView1_InsertItem
public void ListView1_InsertItem([QueryString("PhotoAlbumId")] int photoAlbumId)
{
Picture picture = new Picture();
TryUpdateModel(picture);
FileUpload FileUpload1 = (FileUpload)ListView1.InsertItem.FindControl("FileUpload1");
if (!FileUpload1.HasFile || !FileUpload1.FileName.ToLower().EndsWith(".jpg"))
{
CustomValidator cusValImage = (CustomValidator)ListView1.InsertItem.FindControl("cusValImage");
cusValImage.IsValid = false;
ModelState.AddModelError("Invalid", cusValImage.ErrorMessage);
}
if (ModelState.IsValid && Page.IsValid)
{
using (var myEntities = new PlanetWroxEntities())
{
picture.PhotoAlbumId = photoAlbumId;
string virtualFolder = "~/GigPics/";
string physicalFolder = Server.MapPath(virtualFolder);
string fileName = Guid.NewGuid().ToString();
string extension = System.IO.Path.GetExtension(FileUpload1.FileName);
FileUpload1.SaveAs(System.IO.Path.Combine(physicalFolder, fileName + extension));
picture.ImageUrl = virtualFolder + fileName + extension;
myEntities.Pictures.Add(picture);
myEntities.SaveChanges();
}
}
}
开发者ID:Lancelittle,项目名称:assignment12,代码行数:29,代码来源:ManagePhotoAlbum.aspx.cs
示例10: BufferCB
public int BufferCB(double sampleTime, IntPtr buffer, int len)
{
using (var rgba = new Picture<Rgba, byte>(Width, Height))
using (var gray = new Picture<Gray, byte>(Width, Height))
{
if ((len / 3) == (Width * Height))
{
using (var bgr = new Image<Bgr, byte>(Width, Height, Width * 3, buffer))
{
bgr._Flip(FLIP.VERTICAL);
CvInvoke.cvCvtColor(bgr.Ptr, rgba.Emgu.Ptr, COLOR_CONVERSION.CV_BGR2RGBA);
CvInvoke.cvCvtColor(bgr.Ptr, gray.Emgu.Ptr, COLOR_CONVERSION.CV_BGR2GRAY);
}
}
else
{
gray.Errorize();
rgba.Errorize();
}
OnNext(gray.AddRef(), rgba.AddRef());
}
return 0;
}
开发者ID:JaapSuter,项目名称:Pentacorn,代码行数:25,代码来源:DirectShowCapture.cs
示例11: NewCommand
private void NewCommand(object sender, ExecutedRoutedEventArgs e)
{
var dlog = new NewDocument
{
Owner = this
};
var result = dlog.ShowDialog();
if (!result.HasValue || !result.Value)
{
return;
}
var bmp = new WriteableBitmap(
dlog.ViewModel.Width,
dlog.ViewModel.Height,
96,
96,
PixelFormats.Bgr32,
null);
_picture = new Picture(dlog.ViewModel.Name, bmp);
Title = _picture.Name;
ViewModel.Document = new ReversibleDocument<IPicture>(_picture);
ViewModel.AccessPolicy = new PictureAccessPolicy(_picture);
_image.Source = bmp;
_image.Stretch = Stretch.None;
RenderOptions.SetBitmapScalingMode(_image, BitmapScalingMode.NearestNeighbor);
RenderOptions.SetEdgeMode(_image, EdgeMode.Aliased);
}
开发者ID:julien-lebot,项目名称:photoshop,代码行数:27,代码来源:MainWindow.xaml.cs
示例12: LoadPictures
//Load pictures to the canvas
private void LoadPictures()
{
string[] pictureLocations = GetPictureLocations();
double angle = 0;
double angleStep = 360 / pictureLocations.Length;
foreach (string filePath in pictureLocations)
{
try
{
Picture p = new Picture();
p.ImagePath = filePath;
p.Width = 300;
p.Angle = 180 - angle;
double angleRad = angle * Math.PI / 180.0;
p.X = Math.Sin(angleRad) * 300 + (_canvas.ActualWidth - 300) / 2.0;
p.Y = Math.Cos(angleRad) * 300 + (_canvas.ActualHeight - 300) / 2.0;
_canvas.Children.Add(p);
angle += angleStep;
}
catch (Exception ex)
{
System.Diagnostics.Trace.WriteLine("Error:" + ex.Message);
}
}
}
开发者ID:hoozh,项目名称:multi-touch,代码行数:28,代码来源:MainWindow.xaml.cs
示例13: GetPhotos
public static List<Picture> GetPhotos(string inputFrom, bool R)
{
SearchOption option = R ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly;
string[] files = Directory.GetFiles(inputFrom, "*.jpg", option);
if (files.Length == 0)
return null;
Debug("Found {0} files ", files.Length);
Debug("Building list of photos to process");
List<Picture> pics = new List<Picture>();
int count = 1;
foreach (var file in files)
{
Picture pic = new Picture(file);
pics.Add(new Picture(file));
if (verbosity > 0)
{
drawTextProgressBar(count, files.Length);
}
++count;
}
return pics;
}
开发者ID:NathanW2,项目名称:PhotoMapper,代码行数:25,代码来源:Program.cs
示例14: Sprite
public Sprite (float dx, float dy, int color, int width, int height,
Picture.Format pf) {
x = window.width/2;
y = window.height/2;
this.dx = dx;
this.dy = dy;
this.color = color;
this.width = width;
this.height = height;
pixmap = new Pixmap (display.default_root, width, height,
pf.depth ());
picture = render.create_picture (pixmap, pf,
Picture.Attributes.EMPTY);
if (sprite_gc == null)
sprite_gc = new GC (pixmap);
sprite_gc.set_foreground (0);
pixmap.rectangle (sprite_gc, 0, 0, width, height, true);
sprite_gc.set_foreground (color);
pixmap.arc (sprite_gc, 0, 0, width, height, 0, 360*64, true);
for (int i=0; i<8; i++) {
sprite_gc.set_foreground (divide_color (color, 1<<(7-i)));
pixmap.arc (sprite_gc, i, i, width-2*i, height-2*i,
0, 360*64, true);
}
}
开发者ID:jbnivoit,项目名称:projects,代码行数:31,代码来源:Sprites.cs
示例15: AddPicture
public void AddPicture(AddPictureInput input)
{
if (input != null)
{
var picture = new Picture
{
PictureName = input.PictureName,
Tags = input.Tags,
Description = input.Description,
DateAdded = DateTime.Now,
PictureMimeType = input.PictureMimeType,
PictureData = input.PictureData
};
if (input.UserId.HasValue)
{
var user = new User {
Id = input.UserId.Value
};
picture.AssignedUser = user;
}
_pictureRepository.Insert(picture);
}
}
开发者ID:z0mbieD,项目名称:pictureManager,代码行数:26,代码来源:PictureAppService.cs
示例16: InitLayout
private void InitLayout()
{
this.pic = new Picture();
this.Children.Add(this.pic);
this.button = new Button();
this.pic.Children.Add(this.button);
}
开发者ID:sciaopin,项目名称:bang-sharp,代码行数:8,代码来源:NoActionButtonWidget.Layout.cs
示例17: GetImage
private BitmapImage GetImage(Picture picture)
{
var type = picture.MimeType;
var data = picture.PictureBinary;
var bmp = new BitmapImage();
bmp.StreamSource = new System.IO.MemoryStream(data);
return bmp;
}
开发者ID:martin1cerny,项目名称:BIM-Library-CZ-Revit,代码行数:8,代码来源:ProductRetrievalTests.cs
示例18: StorePicture
public void StorePicture(User user, Picture picture, Stream pictureStream)
{
var storagePath = GetStoragePath(user, picture);
using (var writer = File.OpenWrite(storagePath))
{
pictureStream.CopyTo(writer);
}
}
开发者ID:Gustas,项目名称:Pictures,代码行数:8,代码来源:LocalFilesystemUserPictureStore.cs
示例19: Mod
/// <summary>
/// 修改Books表信息时 添加修改索引(实质上是先删除原有索引 再新增修改后索引)请求至队列
/// </summary>
/// <param name="picture"></param>
public void Mod(Picture.Model.TagModel tag)
{
TagViewMode bvm = new TagViewMode();
bvm.Id = tag.TId;
bvm.Tag = tag.TagName;
bvm.IT = IndexType.Modify;
tagQueue.Enqueue(bvm);
}
开发者ID:RunningStudent,项目名称:PictureWebSite,代码行数:12,代码来源:IndexManager.cs
示例20: NewEmployeePhoto
/// <summary>
/// New employee photo without any link to database
/// </summary>
/// <returns>Employee photo instance</returns>
public EmployeePhoto NewEmployeePhoto(Employee employee, Picture picture)
{
return New<EmployeePhoto>((e) =>
{
e.Employee = employee;
e.Picture = picture;
employee.Photos.Add(e);
});
}
开发者ID:kblc,项目名称:Personnel,代码行数:13,代码来源:EmployeePhoto.cs
注:本文中的Picture类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论