Caner Bulut – R & D notes

Handle an object as variable in a loop with programatically, VB.Net

Posted in Uncategorized by canerblt on July 11, 2011

If you have lots of textboxes or other objects in your project and you need to populate and control these objects programatically, use Controls property of form object to handle this.

An example,

        While sa.Read

            s = s + 1

            Me.Controls(“e” & s).Text = sa.Item(1)
            Me.Controls(“b” & s).Text = sa.Item(2)
            Me.Controls(“x” & s).Text = sa.Item(3)
            Me.Controls(“y” & s).Text = sa.Item(4)

        End While

The names of textboxes created in the loop and then the values which is stored in the DB assigned textboxes’ .text properties.

Image overlaying on a video file with FFMpeg

Posted in Image Processing by canerblt on July 10, 2011

To add a logo/image  on a video file you need FFMpeg with vhook lib. New versions of FFMpeg cut the support for this lib. So you should find older FFMpeg versions with vhook DLL files. There are two DLL files under vhook directory which can be used for image overlaying. Watermark.dll and Imlib2.dll.

The below command can be run on CMD or CLI,

ffmpeg -i son.flv -vhook “imlib2.dll -x 10 -y 10 -i arge.png”  b1.flv

The arge.png file will be cordinated with x and y values on video. The son.flv video file will be converted wiht image overlaying to b1.flv vide file.

Thanks.

Changing FPS rate of a video with FFMPEG

Posted in Image Processing by canerblt on July 10, 2011

If you want to change frame per second (fps) rate of a video file, you need a codec to achieve that. We can use FFMpeg to change this rate. You can run below script via CMD on windows or CLI on Linux.

 

ffmpeg -r 10 -f image2 -i C:\test\captures\image%d.png  C:\test\captures\test2.flv

A point to keep it mind that,

-r 10   : define new fps rate

image2 : image file format

C:\5d\captures\image%d.png : image files in a directory which will be converted a video

C:\5d\captures\test2.flv : destination file name

 

If you have any problem of this script please share it with a comment.

Eclipse 3.4 Klavye Kısayolları(Shortcuts)

Posted in Java by canerblt on December 7, 2010

Eclipse 3.4 için kullanabileceğiniz kısayolları (shortcuts) asağıdaki adreste bulabilirsiniz.

Eclipse 3.4 KeyBoard Shortcuts Reference

Iyi çalışmalar.

JBoss “The procedure entry point JVM_FindClassFromBootLoader could not be located in the dynamic link library in jwm.dll” hatasının çözümü

Posted in Java by canerblt on September 23, 2010

Eğer aşağıdaki ekrandaki hatayı alıyorsunuz yapılması gereken bilgisayarınızın çevresel değişkenlerindeki JAVA_HOME değerini kontrol etmektir.

(more…)

Java Unknown column ‘XXXX’ in ‘field list’ Hatası ve Çözümü

Posted in Java by canerblt on September 16, 2010

Java Unknown column ‘XXXX’ in ‘field list’ Hatasi ve Çözümü

Eger Java ile Mysql yada herhangi bir veritabani ile ugrasiyorsaniz ve asagidaki gibi bir hata aliyorsaniz, bu yazida çözümü sizlerle paylasayim. Çözüm çok kolay olmasina ragmen can sikici olabiliyor.

java.sql.SQLException: Unknown column ‘denmeer’ in ‘field list’
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
(more…)

Java SWT Dialog ve MessageBox Kullanımı

Posted in Java by canerblt on August 26, 2010

Bu yazımda GUI uygulamalarında en sık kullanılan ve hepimizin çok yakından tanıdığı Dialoglar konusu ile ilgili bilgiler ve uygulamalar bulabilirsiniz. Dialoglar kullanıcılardan veri almak için kullanılan uygulamalardır. SWT içerisinde çok sayıda Dialog çeşidi vardırö aşağıdaki uygulamada en çok kullanılanlara örnekler vermeye çalıştım.

import org.eclipse.swt.SWT;
import org.eclipse.swt.printing.PrintDialog;
import org.eclipse.swt.printing.Printer;
import org.eclipse.swt.printing.PrinterData;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.*;

(more…)

Java SWT Slider ve ProgressBar Kullanımı

Posted in Java by canerblt on August 24, 2010

SWT kütüphanesinde kullanılan diğer iki kullanışlı kompanentler ise slider ve progressBar. Bu classlar sayesinde daha interaktif arayüzler geliştirebilirsiniz. Aşağıdaki örnek hem slider hemde progressBar için örnek teşkil etmektedir.

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.*;
public class sliderPBar {
(more…)

Java SWT CoolBar Kullanımı

Posted in Java by canerblt on August 24, 2010

SWT içerisinde bildiğimiz gibi ToolBar classları ile istediğimiz toolbarları kolaylıkla oluşturabiliyorduk. Toolbar oluşturabilmek için kullanılabilecek bir diğer yöntemde CoolBar ve CoolItem classlarını kullanarak arayüzler geliştirmektir. Aşağıdaki örnekte 5 buttondan oluşan bir CoolBar uygulaması görebilirsiniz.

import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTError;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.graphics.Point;
public class coolBar {
(more…)

Tagged with: , , ,

Java SWT MouseEvent ve MouseListener Kullanımı

Posted in Java by canerblt on August 24, 2010

Mouseler GUI’leri kullanırken en ço kullanılan araçlardır. SWT üzerinde mouse hareketlerini algılamak ve GUI özelliklerini bu hareketlere göre şekilledinrebilmemizi sağlayan kütüphaneler bulunmaktadır. Aşağıdaki örnekte bir kaç mouse listener örneğini görebilirsiniz.

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.MouseMoveListener;
import org.eclipse.swt.events.MouseTrackListener;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;
import java.util.Random;
import org.eclipse.swt.graphics.Point;
public class mListener {

(more…)

Follow

Get every new post delivered to your Inbox.