'''' This code is part of Document Solutions for Imaging demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.DrawingImportsSystem.Collections.GenericImportsSystem.LinqImportsSystem.NumericsImportsGrapeCity.Documents.DrawingImportsGrapeCity.Documents.Imaging '' This sample demonstrates how to find and show pixels with clipped shadows.'' This sample is identical to ShowLoClippingTiff but uses a JPEG image'' rather than a TIFF created from the same source photo.PublicClassShowLoClippingJpegFunctionGenerateImage(ByVal pixelSize AsSize,ByVal dpi AsSingle,ByVal opaque AsBoolean,OptionalByVal sampleParams AsString() = Nothing) AsGcBitmap Dim bmp = NewGcBitmap(pixelSize.Width, pixelSize.Height, opaque, dpi, dpi)Using bmpSrc = NewGcBitmap(Path.Combine("Resources", "ImagesBis", "clivia.jpg"))'' BitBlt requires the opacity of both images to be the same: bmpSrc.Opaque = opaque'' Render source image onto the target bitmap'' (generally we might want to resize the source image first,'' but in this case we just know that the source image has'' the same size as the target, so skip this step): bmp.BitBlt(bmpSrc, 0, 0)Using g = bmp.CreateGraphics()For i = 0To bmp.PixelWidth - 1For j = 0To bmp.PixelHeight - 1'' If all of the colors are 0x00, we change the pixel's color to magenta:If (bmp(i, j) And&HFFFFFF) = 0Then bmp(i, j) = &HFFFF00FFUIEndIfNextNext'' Draw the original image in the bottom right corner for reference:Dim rc = NewRectangleF(0, 0, pixelSize.Width / 4, pixelSize.Height / 4) g.DrawImage(bmpSrc, rc, Nothing, ImageAlign.StretchImage) g.DrawRectangle(rc, Color.LightGray)EndUsingEndUsingReturn bmpEndFunctionEndClass