CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Image
 <Image Margin="367.056,8,8,0" VerticalAlignment="Top" Name="imgLargePreview" Width="640" Height="480" MaxHeight="480" MaxWidth="640" />
 
 
 
 
Private Sub Button1_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles Button1.Click
        saveImage()
    End Sub
    Sub saveImage()
        Dim encoder = New PngBitmapEncoder()
by DaveCS   May 15, 2012 @ 7:52am
14 Views
no comments
 
//UMBRACO 4.7//
 
<!--Inserting Image using inline XSLT-->
<umbraco:Item runat="server" field="mediaItem" xslt="concat('&lt;img src=&quot;',umbraco.library:GetMedia({0}, true())/umbracoFile, '&quot; /&gt;')" xsltDisableEscaping="true"/>
 
<!--Getting item value from other node-->
<umbraco:Item runat="server" Field="Title" NodeId="1282" />
 
<!--Getting the current page node (On backend)-->
Node.GetCurrent().Id
by Egli   December 04, 2011 @ 10:00pm
95 Views
no comments
 
C#
public class HandleTheme
{
    // light
    public static string GetLightUrl(DependencyObject obj)
    {
        return (string)obj.GetValue(LightUrlProperty);
    }
    public static void SetLightUrl(DependencyObject obj, string value)
    {
        obj.SetValue(LightUrlProperty, value);
by Jerry Nixon   November 18, 2011 @ 9:36am
146 Views
no comments
 
C#
public static BitmapImage _ToBitmapImage(this Bitmap bitmap)
{
    var _MemoryStream = new MemoryStream();
    bitmap.Save(_MemoryStream, ImageFormat.Png);
 
    var _BitmapImage = new BitmapImage();
    _BitmapImage.BeginInit();
    _BitmapImage.StreamSource = _MemoryStream;
    _BitmapImage.EndInit();
by Jerry Nixon   August 22, 2011 @ 9:43am
94 Views
no comments
 
Public Function generateGrayScaleImage(ByVal sourcePath As String, ByVal destinationPath As String) As Boolean
        Dim originalImage As Bitmap = Nothing
        Dim newBitmap As Bitmap = Nothing
        Dim g As Graphics = Nothing
        Dim success As Boolean = False
 
        If File.Exists(sourcePath) Then
            Try
                originalImage = Bitmap.FromFile(sourcePath)
            Catch ex As Exception
by Yasser   February 10, 2011 @ 5:22am
223 Views
no comments
 
XML
<Border BorderBrush="Black" BorderThickness="1.5" CornerRadius="12">
    <Border.Background>
        <ImageBrush>
            <ImageBrush.ImageSource>
                <BitmapImage UriSource="c:\temp\happy.jpg" />
            </ImageBrush.ImageSource>
        </ImageBrush>
    </Border.Background>
</Border>
by bnaya   February 08, 2011 @ 7:19am
267 Views
no comments
 
Rect rect = new Rect(canvas.RenderSize);
RenderTargetBitmap rtb = new RenderTargetBitmap((int)rect.Right,
  (int)rect.Bottom, 96d, 96d, System.Windows.Media.PixelFormats.Default);
rtb.Render(canvas);
//endcode as PNG
BitmapEncoder pngEncoder = new PngBitmapEncoder();
pngEncoder.Frames.Add(BitmapFrame.Create(rtb));
 
//save to memory stream
System.IO.MemoryStream ms = new System.IO.MemoryStream();
by bnaya   May 03, 2010 @ 11:58am
203 Views
no comments
 
C#
//სურათის ობიექტის კონვერტაცია ბაიტების მასივში.
private byte[] ImageToByteArray(System.Drawing.Image imageIn) {
 MemoryStream ms = new MemoryStream();
 imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
 return ms.ToArray();
}
 
//სურათის ბაიტების მასივის კონვერტაცია სურათის ობიექტში
private Image ByteArrayToImage(byte[] byteArrayIn) {
 MemoryStream ms = new MemoryStream(byteArrayIn);
by Zviadi   March 24, 2010 @ 1:20pm
406 Views
no comments
 
 /*database name here*/
 $database = '';
 /*host name for MySQL*/
 $hostname = 'localhost';
 /*user name for MySQL*/
 $username = '';
 /*password for MySQL*/
 $password = '';
 
 //Get the h3fileid
by CodeMonkey76   February 10, 2010 @ 10:58pm
245 Views
no comments
 
C#
public static void ResizeImage()
{
    using (Bitmap src = new Bitmap(_ImgOriginal))
    {
        int destWidth = (int)(0.5 * src.Width);
        int destHeight = (int)(0.5 * src.Height);
        
        using (Bitmap dest = new Bitmap(destWidth, destHeight))
        using (Graphics gDest = Graphics.FromImage(dest))
        {
by Jon Sagara   January 14, 2010 @ 4:31pm
Tags: c#, gdi+, image, resize
355 Views
no comments
 
C++
#include <nds.h>
 
#include <boost/cstdint.hpp>
#include <boost/gil/algorithm.hpp>
#include <boost/gil/image_view.hpp>
#include <boost/gil/packed_pixel.hpp>
#include <boost/gil/rgba.hpp>
#include <boost/gil/virtual_locator.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/utility/binary.hpp>
by Matt Calabrese   January 05, 2010 @ 3:34pm
738 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate