Gif是图像ANDROID的碎片

问题描述 投票:1回答:1

我尝试以编程方式共享图像,但是它作为图像共享我的代码:

Intent shareIntent = new Intent();
            shareIntent.setType("image/gif");//image/gif
            shareIntent.setAction(Intent.ACTION_SEND);
            shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(myList.get(item)));
            startActivity(Intent.createChooser(shareIntent,"Share gif"));
java android image share gif
1个回答
1
投票
    / saved image format (default SaveImageAs.Jpeg)
    // other choices are: IndexedImage, GrayImage, BWImage
    MyImage.SaveAs = SaveImageAs.Jpeg;

    // Crop rectangle is the image area to be cropped.
    // The default is no crop (empty rectangle).
    // The origin is at top left and Y axis is pointing down.
    // The dimensions are in pixels.
    // The crop rectangle must be contained within the image.
    MyImage.CropRec = new Rectangle(x, y, width, height);

    // Crop percent rectangle is the image area to be cropped.
    // The default is no crop (empty rectangle).
    // The origin is at top left and Y axis is pointing down.
    // The dimensions are in percent of image.
    // The crop rectangle must be contained within the image.
    MyImage.CropPercent = new RectangleF(x, y, width, height);

    // Image Quality is an integer in the range of 0 to 100.
    // representing poor to best quality image.
    // The default (-1) is save image with Bitmap default quality.
    // For your information Bitmap class default image quality is 75.
    // Lower image quality means smaller PDF file.
    MyImage.ImageQuality = PdfImage.DefaultQuality;

    // Image resolution sets the image resolution provided
    // that it is smaller than the resolution of source image.
    // Default of 0, is keeping the original image resolution.
    // Resolution is specified in pixels per inch.
    // Reduced resolution means smaller PDF file.
    MyImage.Resolution = 0;

// Cutoff value for gray conversion to black and white.
// The range is 1 to 99. The default is 50.
// If shade of gray is below cutoff, the result is black.
// If shade of gray is above cutoff, the result is white.
MyImage.GrayToBWCutoff = 50;

// Reverse black and white
// Default is false
// In Gray or BW images the color is reversed
MyImage.ReverseBW = false;

// Attach to layer control
// Image visibility will be controlled by viewer application.
MyImage.LayerControl = PdfLayer;
Load image into PdfImage object. NOTE: the loading method saves the image in the PDF output file. Once this step is done the image cannot be changed.

Hide   Copy Code
// use one of 5 methods to load the image.
// image source can be a file, Bitmap,
// BW bool array, QRCode or Pdf417 barcode
MyImage.LoadImage(image_source);
Draw the image into the PDF Document.

Hide   Copy Code
// draw the image
Contents.DrawImage(MyImage, PosX, PosY, Width, Height);
If you want the image to maintain correct aspect ratio use ImageSize or ImageSizePosition to calculate the width and height. If the ratio of width and height is not the same as the image, the image will look stretched in one of the directions.

Hide   Copy Code
// calculate the largest rectangle with the correct
// aspect ratio 
SizeD MyImage.ImageSize(Double Width, Double Height);
Hide   Copy Code
// calculate the largest rectangle with
// correct aspect ratio that will fit in a given area and
// position. It based on <code>ContentAlignment</code> enumeration.
ImageSizePos ImageSizePosition(Double Width, Double Height, ContentAlignment Alignment);
2.5. Barcode Support
The code below illustrates how to include UPC-A barcode in a PDF document.

Hide   Copy Code
// create barcode object
BarcodeEAN13 Barcode = new BarcodeEAN13("123456789010");

// draw the barcode including text under the barcode

Contents.DrawBarcode(PosX,PosY,BarWidth,BarcodeHeight,Barcode,Font,FontSize);在这种情况下,类为BarcodeEAN13,输入字符串为12位数字。结果是UPC-A条码。

PDF File Writer库包括一个基类Barcode。对于每种受支持的条形码,都需要一个派生类。该类库包括四个派生类:Barcode128,Barcode39,BarcodeInterleaved2of5和BarcodeEAN13。如果输入字符串为13位数字,则BarcodeEAN13生成EAN-13条形码;如果输入字符串为12位数字,则产生UPC-A。具有13位数字和前导零的输入字符串被视为UPC-A。

DrawBarcode方法具有许多重载。您可以指定条形码左下角的位置,窄条的宽度,条形码的高度以及派生的条形码类别。有可选参数:用于显示文本的对齐方式(左,中,右)颜色和字体。条形码周围的安静区域是您的责任。条形码下方显示可选文本。如果选择黑色以外的颜色,则应确保与背景的对比度明显。使用示例在3.7绘图条形码,ArticleExample.cs和OtherExample.cs中给出。

如果要为另一个条形码创建派生类,请以包含的三个类的源代码为例。

© www.soinside.com 2019 - 2024. All rights reserved.