我有一些代码,它将图像呈现到表单中,并使用跟踪条旋转该图像。代码是从一个你管教程和工作。然而,当图像旋转时,它会闪烁。教程海报上说,使用线程将消除闪烁,但我不知道如何去做。任何帮助都将不胜感激。守则列示如下:
public partial class Form1 : Form
{
Image img;
int angle;
public Form1()
{
InitializeComponent();
}
Thread th;
Graphics graphicToDraw;
Graphics graphicT
我有一个应用程序,它为用户显示了相当多的图像,我们已经看到了许多错误报告与OutOfMemoryError异常。
我们现在做的是这样的:
// Check if image is a landscape image
if (bmp.getWidth() > bmp.getHeight()) {
// Rotate it to show as a landscape
Matrix m = image.getImageMatrix();
m.postRotate(90);
bmp = Bitmap.createBitmap(bmp, 0, 0, bmp.get
我有一个控制台应用程序,在执行OCR之前,在大型TIFF图像(大约6MB的图像)上执行一些OCR,我需要旋转图像。
我导入了system.drawing命名空间,旋转代码如下所示:
Dim bmp As System.Drawing.Bitmap
bmp = New System.Drawing.Bitmap(fileName)
bmp.RotateFlip(RotateFlipType.Rotate270FlipNone)
bmp.Save(fileName, System.Drawing.Imaging.ImageFormat.Tiff)
有时它有效,有时它给我的参数是无效的错误。
public void Rotate(View v)
{
ImageView img = (ImageView)findViewById(R.id.imageView1);
Bitmap bmp = BitmapFactory.decodeResource(getResources(),arr[current]);
// Getting width & height of the given image.
int w = bmp.getWidth();
int h = bmp.getHeight();
// Setting pre rotate t
我有一个图像,我选择一个随机点。图像以用户希望的任意程度旋转。这里的目标是找到像素的新坐标。我用这种方法尝试了RotatePoint函数,其中像素的原始位置为(100,370),图像旋转了270度,但是新的坐标不正确。我怎样才能得到正确的新坐标?
static public void RotatePoint(float angle)
{
var a = angle * System.Math.PI / 180.0;
float cosa = (float)Math.Cos(a), sina = (float)Math.Sin
在Android(2.3.3)上,有可能使图像的旋转不是即时的吗?
我使用的代码示例来自
img=(ImageView)findViewById(R.id.ImageView01);
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.refresh);
// Getting width & height of the given image.
int w = bmp.getWidth();
int h = bmp.getHeight();
// Setting post rotate to 90
M
我的程序分批处理一些图像,我目前需要读取图像的exif方向标签,将其旋转到正确的方向,进行一些处理,保存图像时不需要任何EXIF定位标签,但要有适当的旋转。(或使用具有正确方向的EXIF标记)
我正在使用阅读EXIF和旋转
var bmp = new Bitmap(pathToImageFile);
var exif = new EXIFextractor(ref bmp, "n"); // get source from http://www.codeproject.com/KB/graphics/exifextractor.aspx?fid=207371
我正在试着开发一个简单的游戏。我的问题是,我试图通过跟随来自Touch Listener的"x“事件在屏幕底部旋转箭头图像。
下面是我的Arrow类:
public class Arrow extends GameObject{
boolean show = true;
Bitmap bmp;
Game game;
Matrix matrix;
int i = 0;
public Arrow(Handler handler, int x, int y, int xSpeed, int ySpeed , Game game) {
我正在尝试写一个程序,可以旋转一个给定的BMP文件180度,并用旋转后的图像创建一个新的BMP文件。我使用的是EasyBMP库。但是,每次我尝试编译时,都会收到以下警告:
EasyBMP Warning: Attempted to access non-existent pixel (359, 236);
Truncating request to fit in the range [0,358] x [0,269].
我得到了成百上千个这样的东西!(有问题的图像是359x270)奇怪的是,我的代码实际上是100%工作的。当我运行这个程序时,它确实创建了一个旋
如何旋转图像而不像这样显示?
这是我的轮换方法:
public static Bitmap RotateImageN(Bitmap bmp, float angle)
{
Bitmap rotatedImage = new Bitmap(bmp.Width, bmp.Height);
using (Graphics g = Graphics.FromImage(rotatedImage))
{
// Set the rotation point to the center in the matrix
我需要在图像上找到对象,所以我尝试使用AForge库来实现。我已经从非常简单的模式和图片开始了,但是识别精度已经很糟糕了。我使用的是ExhaustiveTemplateMatching:
ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching(0);
Bitmap img = new Bitmap("C:/img.bmp");
Bitmap pat = new Bitmap("C:/pat.bmp");
TemplateMatch[] matchings = tm.ProcessImage(i
我正在使用easeljs将位图图像加载到画布上。我可以应用旋转,我想得到修改后的dataUrl图像,显示旋转。但是当使用cache或getCacheDataURL时,旋转似乎被忽略了。
示例代码--
var stage = new createjs.Stage("canvas");
// Create an image.
var image = new Image();
// Since this sample is cross-domain, we must set this flag.
// Note that the origin server supports CO