Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6715125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:34:38+00:00 2026-05-26T08:34:38+00:00

I recently started a small project in which I wanted to use zxing. I

  • 0

I recently started a small project in which I wanted to use zxing. I downloaded the sources from here. I was able to successfully build the core and the javase jars.

When I tried to code along the sample provided here I ran into a problem I do not quite understand. So far the code looks like this:

public static void main(String[] args)
{
   Reader reader = new MultiFormatReader();
   ImageIcon imageIcon = new ImageIcon(SOMEPATH);
   Image image = imageIcon.getImage();

   BufferedImage buffImage = new BufferedImage(
      image.getWidth(null), 
      image.getHeight(null), 
   BufferedImage.TYPE_INT_RGB);

   Graphics2D g = buffImage.createGraphics();
   g.drawImage(image, null, null);

   LuminanceSource source = new BufferedImageLuminanceSource(buffImage);
   BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
}

As you can see this is pretty much the same code as presented in the DevelopersNotes. But the code will not compile. The error message is:

Type mismatch: cannot convert from BufferedImageLuminanceSource to LuminanceSource

Does somebody know what I am missing?

Edit:
My imports are currently looking like this:

import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;

import javax.swing.ImageIcon;

import com.google.zxing.BinaryBitmap;
import com.google.zxing.LuminanceSource;
import com.google.zxing.MultiFormatReader;
import com.google.zxing.Reader;
import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
import com.google.zxing.common.HybridBinarizer;

I added the core.jar as well as the javase.jar to my project. Both I compiled using ant leaving the buildfiles as downloaded.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:34:38+00:00Added an answer on May 26, 2026 at 8:34 am

    That’s all correct. You must have some funny business in your imports. Those types are certainly compatible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I downloaded Flash Builder from here : Download I recently started writing some small
I've recently started a Rails 3 project which I checked out from github. The
I recently started using scons to build several small cross-platform projects. One of these
I recently started a small personal project (RGB value to BGR value conversion program)
I've recently started exploring using AJAX for a small project, and I've had reasonable
I've recently started looking at Merb, for use with some small projects around the
We've recently started a small-ish project for a mobile site demo w/.NET4; jquery-mobile has
recently I started a small Django project that I developed on a local machine
I recently started reading Evans' Domain-Driven design book and started a small sample project
I have been working with a small project recently which involves Struts 2 and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.