惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
月光博客
月光博客
T
Threat Research - Cisco Blogs
小众软件
小众软件
有赞技术团队
有赞技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
T
Tailwind CSS Blog
Cisco Talos Blog
Cisco Talos Blog
V
V2EX
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
The Last Watchdog
The Last Watchdog
Simon Willison's Weblog
Simon Willison's Weblog
T
Threatpost
S
Secure Thoughts
O
OpenAI News
P
Proofpoint News Feed
S
SegmentFault 最新的问题
Forbes - Security
Forbes - Security
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
宝玉的分享
宝玉的分享
Scott Helme
Scott Helme
T
Tenable Blog
A
Arctic Wolf
L
LINUX DO - 热门话题
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
Hacker News: Ask HN
Hacker News: Ask HN
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
博客园 - Franky
WordPress大学
WordPress大学
Know Your Adversary
Know Your Adversary
博客园_首页
雷峰网
雷峰网
IT之家
IT之家
PCI Perspectives
PCI Perspectives
L
LINUX DO - 最新话题
H
Heimdal Security Blog

博客园 - Advance

微软的操作系统已占据96.97%的市场份额(来自OneStat.com的权威调查) 软件测试常识(转载自51testing.com) 安装Rational Enterprise Suite(Robot...)时遇到的问题及解决办法! 如何解决:将字符串转换为 uniqueidentifier 时出现语法错误 这是春的气息? Microsoft系列 常见漏洞及解决方法 .NET(C#)连接各类数据库-集锦 让人深恶痛绝的编码问题?博客园也出现了乱码现象! 炎炎夏日,酷暑难耐! Mono使用日志(2) Mono使用日志(1) Visual Studio 2005 Beta2 简体中文版发布 C#在OpenGL编程中的应用--关于摩尔纹的研究 VS.NET2005为何无法连接数据库? C#中对ActiveX控件的调用 怎样获取本地机器的MAC地址 在ASP.NET中指定出错页面,不让代码外泄! 有人尝试过用C#写一个操作系统吗? [发布]★以学校为背景做的CS游戏地图★
C#-Imaging - Moire Fringe (摩尔纹)
Advance · 2005-05-03 · via 博客园 - Advance

using System;
using System.Drawing;
using System.Drawing.Imaging;

namespace CSharp_Imaging_Moire_Fringe
{
    
public sealed class Imaging
    
{
        
private static BitmapData _BitmapData = new BitmapData();
        
        
#region Moire_Fringe( Bitmap ObjectBitmap )

        
public static void Moire_Fringe( Bitmap ObjectBitmap )
        
{
            
try
            
{
                
if( ObjectBitmap == null )
                
{
                    
return;
                }


                _BitmapData 
= ObjectBitmap.LockBits( new Rectangle( 0 , 0 , ObjectBitmap.Width , ObjectBitmap.Height ) , ImageLockMode.ReadWrite , PixelFormat.Format24bppRgb );
                
                
unsafe
                
{
                    
byte* P = (byte *)_BitmapData.Scan0;

                    
forint i = 0 ; i < _BitmapData.Height / 2 ; i++ )
                    
{    
                        
forint j = 0 ; j < _BitmapData.Width / 2 ; j++ )
                        
{    
                            P 
+= 3;    
                            P[
2= P[1= P[0= 0;
                            P 
+= 3;
                        }


                        
forint k = 0 ; k < _BitmapData.Width / 2 ; k++ )
                        
{    
                            P[
2= P[1= P[0= 0;
                            P 
+= 6;
                        }

                    }

                }

            }

            
catch( Exception E )
            
{
                System.Windows.Forms.MessageBox.Show( E.ToString() );
            }

            
finally
            
{
                ObjectBitmap.UnlockBits( _BitmapData );
            }

        }
    
    
        
#endregion

    }

}

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;

namespace CSharp_Imaging_Moire_Fringe
{
    
public class Form1 : System.Windows.Forms.Form
    
{
        
#region Windows 窗体设计器生成的代码
        
        
private System.Windows.Forms.PictureBox pictureBox1;
        
private System.Windows.Forms.PictureBox pictureBox2;
        
private System.ComponentModel.IContainer components = null;

        
public Form1()
        
{
            InitializeComponent();
        }


        
protected override void Dispose( bool disposing )
        
{
            
if( disposing )
            
{
                
if (components != null
                
{
                    components.Dispose();
                }

            }

            
base.Dispose( disposing );
        }


        
/// <summary>
        
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
        
/// 此方法的内容。
        
/// </summary>

        private void InitializeComponent()
        
{
            System.Resources.ResourceManager resources 
= new System.Resources.ResourceManager(typeof(Form1));
            
this.pictureBox1 = new System.Windows.Forms.PictureBox();
            
this.pictureBox2 = new System.Windows.Forms.PictureBox();
            
this.SuspendLayout();
            
// 
            
// pictureBox1
            
// 
            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
            
this.pictureBox1.Location = new System.Drawing.Point(4438);
            
this.pictureBox1.Name = "pictureBox1";
            
this.pictureBox1.Size = new System.Drawing.Size(256256);
            
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            
this.pictureBox1.TabIndex = 0;
            
this.pictureBox1.TabStop = false;
            
// 
            
// pictureBox2
            
// 
            this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
            
this.pictureBox2.Location = new System.Drawing.Point(33238);
            
this.pictureBox2.Name = "pictureBox2";
            
this.pictureBox2.Size = new System.Drawing.Size(256256);
            
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
            
this.pictureBox2.TabIndex = 1;
            
this.pictureBox2.TabStop = false;
            
// 
            
// Form1
            
// 
            this.AutoScaleBaseSize = new System.Drawing.Size(614);
            
this.BackColor = System.Drawing.Color.White;
            
this.ClientSize = new System.Drawing.Size(632333);
            
this.Controls.Add(this.pictureBox2);
            
this.Controls.Add(this.pictureBox1);
            
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            
this.MaximizeBox = false;
            
this.Name = "Form1";
            
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            
this.Text = "C# - Imaging - Moire Fringe";
            
this.Load += new System.EventHandler(this.Form1_Load);
            
this.ResumeLayout(false);

        }

        

        [STAThread]
        
private static void Main() 
        
{
            Application.Run( 
new Form1() );
        }


        
#endregion


        
private void Form1_Load( object sender, System.EventArgs e )
        
{
            Imaging.Moire_Fringe( (Bitmap)pictureBox2.Image );
        }

    }

}