public ImageElement(string resourceName, bool keepAspect) { this.image = ResourceManager.Instance.GetIImage(resourceName); KeepAspect = keepAspect; if (image != null) { this.ImageSize = new Size(image.Size.Width.ToLogic(), image.Size.Height.ToLogic()); this.Size = ImageSize; } }
public AlphaImage(string resourceName, System.Reflection.Assembly assembly) { try { var factory = (IImagingFactory)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("327ABDA8-072B-11D3-9D7B-0000F81EF32E"))); IImage img; IImage imagingResource; using (var strm = (MemoryStream)assembly.GetManifestResourceStream(resourceName)) { var pbBuf = strm.GetBuffer(); var cbBuf = (uint)strm.Length; factory.CreateImageFromBuffer(pbBuf, cbBuf, BufferDisposalFlag.BufferDisposalFlagNone, out imagingResource); } _img = new IImageWrapper(imagingResource); } catch (Exception e) { //!! write to log (e.StackTrace, "SetBtnImg") } }
public TransparentButton(IImageWrapper image) { this.image = image; this.Size = image.Size; }
public static Graphics DrawPng(this Graphics gr, IImageWrapper pngImage, Rectangle destRect) { #if WINCE var hDc = gr.GetHdc(); pngImage.Draw(hDc, destRect, new Rectangle(0, 0, pngImage.Size.Width, pngImage.Size.Height)); gr.ReleaseHdc(hDc); #else if (pngImage.Image is Win32Image) { gr.DrawImage( ((Win32Image)pngImage.Image).bitmap, destRect, new Rectangle(0, 0, pngImage.Size.Width, pngImage.Size.Height), GraphicsUnit.Pixel); } #endif return gr; }
public static Graphics DrawPng(this Graphics gr, IImageWrapper pngImage, Rectangle destRect, Rectangle sourceRect) { #if WINCE var hDc = gr.GetHdc(); pngImage.Draw(hDc, destRect, sourceRect); gr.ReleaseHdc(hDc); #endif #if __ANDROID__ if (pngImage.Image is AImage) { gr.DrawImage( ((AImage)pngImage.Image).bitmap, destRect, sourceRect, GraphicsUnit.Pixel); } #endif #if WIN32 || XNA if (pngImage.Image is BasicImage) { gr.DrawImage( ((BasicImage)pngImage.Image).bitmap, destRect, sourceRect, GraphicsUnit.Pixel); } #endif return gr; }
public static Graphics DrawPng(this Graphics gr, IImageWrapper pngImage, Rectangle destRect) { return DrawPng(gr, pngImage, destRect, new Rectangle(0, 0, pngImage.Size.Width, pngImage.Size.Height)); }
public IDrawingGraphics DrawAlphaImage(IImageWrapper image, System.Drawing.Rectangle destRect, System.Drawing.Rectangle sourceRect) { var destScaledRect = this.CalculateRect(destRect); if (image != null) { this.Graphics.DrawPng(image, destScaledRect, sourceRect); } this.state.CurrentX = destRect.Right; this.ValidateExtends(0, destScaledRect.Bottom); return this; }
public IDrawingGraphics DrawAlphaImage(IImageWrapper image, int x1, int y1, int width, int height) { return this.DrawAlphaImage(image, new Rectangle(x1, y1, width, height)); }
public IDrawingGraphics DrawAlphaImage(IImageWrapper image, int x, int y) { throw new NotImplementedException(); }
public TransparentImageElement(IImageWrapper image) { this._image = image; this.Size = image.Size; }