Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

  • Author

Alright, so I've put the line below, but what do I put in for icons? Do I put a resource location? How do I do this?

 

Display.setIonc(icons);

I am on my journey of making a remake of matmos, as explained here.

  • Author

Hmm. Why does this keep erroring me?

 

	public static void SetIcon(BufferedImage Icon32x, BufferedImage Icon16x) {

	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	ImageIO.write(Icon32x, "png", baos);
	byte[] image1byte = baos.toByteArray();
	ByteBuffer image1 = ByteBuffer.wrap(image1byte);

	ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
	ImageIO.write(Icon16x, "png", baos2);
	byte[] image2byte = baos2.toByteArray();
    ByteBuffer image2 = ByteBuffer.wrap(image2byte);

	ByteBuffer[] list = new ByteBuffer[2];
	list[0] = image1;
	list[1] = image2;
	Display.setIcon(list);
}

I am on my journey of making a remake of matmos, as explained here.

  • Author

I changed it to jpg and it still errors. When I hover over the line that errors (the ImageIO.write), it'll give me two options:

 

Unhandled exception type IOException

 

- Add throw

- Add catch

 

ClientProxy.SetIcon(ImageIO.read(new File("src/Images/Tests/icon32.png")), ImageIO.read(new File("src/Images/Tests/icon32.png")));

 

public static void SetIcon(BufferedImage Icon32x, BufferedImage Icon16x) {

	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	ImageIO.write(Icon32x, "jpg", baos);
	byte[] image1byte = baos.toByteArray();
	ByteBuffer image1 = ByteBuffer.wrap(image1byte);

	ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
	ImageIO.write(Icon16x, "jpg", baos2);
	byte[] image2byte = baos2.toByteArray();
    ByteBuffer image2 = ByteBuffer.wrap(image2byte);

	ByteBuffer[] list = new ByteBuffer[2];
	list[0] = image1;
	list[1] = image2;
	Display.setIcon(list);
}

I am on my journey of making a remake of matmos, as explained here.

  • Author

No what it does is take the image and turn it info a ByteBuffer.

 

The below still set the icon of those bytebuffers,

 

ByteBuffer[] list = new ByteBuffer[2];
list[0] = image1;
list[1] = image2;
Display.setIcon(list);

 

Below, before above creates the byte buffers,

 

	ByteArrayOutputStream baos = new ByteArrayOutputStream();
	ImageIO.write(Icon32x, "jpg", baos);
	byte[] image1byte = baos.toByteArray();
	ByteBuffer image1 = ByteBuffer.wrap(image1byte);

	ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
	ImageIO.write(Icon16x, "jpg", baos2);
	byte[] image2byte = baos2.toByteArray();
       ByteBuffer image2 = ByteBuffer.wrap(image2byte);

I am on my journey of making a remake of matmos, as explained here.

  • Author

It takes the JPG and turns it into a ByteBuffer. The function calls for a ByteBuffder If I am doing anything wrong please explain to me how to do it right, I'm always open to learn!  >:(;)

I am on my journey of making a remake of matmos, as explained here.

Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.