B4i Question B4i Bitmap.initialize mutable ? - JordiCP (first post)    Mar 02, 2022   (1 reaction) Initialize the canvas to a View. This view doesn't need to be in the layout. Only need to initialize it and assigned dimensions
Draw on it and then get the bitmap
Something similar to (untested, there may be small typos but that's the idea)
Dim cvs As B4XCanvas
Dim myView as B4XView
myView.initial B4A Question Create a mutable bitmap and draw over it with Canvas - klaus (first post)    Jan 09, 2023   (1 reaction) This line initializes a black bitmap.
bmp.InitializeMutable(iWidth * 100dip / 100, iHeight * 100dip / 100)
To get the image on the bitmap you need to draw it with the Canvas.
Dim rct As Rect
rct.Initialize(0, 0, iWidth* 100dip / 10, iHeight* 100dip / 100)
cvsTest.DrawBitmap(LoadBitmap(Fi B4A Library [Lib, Chargeable] MFLib 2 - tons of functions for B4A - MaFu (first post)    Aug 09, 2016   (1 reaction) image library (MFImage.jar) part 2
Part 1
MF_Image
Methods:
...
Invert (bmp As Bitmap) As Boolean
Inverts the given bitmap.
Invert2 (bmpIn As Bitmap, bmpOut As Bitmap) As Boolean
Inverts the given bitmap.
Invert3 (bmp As Bitmap) As Bitmap
Inverts the given bitmap.
LoadBitmap (dir As String, file B4A Question Bitmaps less bulky for printing purposes ? - Erel (first post)    Jun 05, 2019   (1 reaction) You can use this (untested) code to create a mutable bitmap with different configuration: Sub Create565Bitmap(Width As Int, Height As Int) As Bitmap Dim jo As JavaObject Return jo.InitializeStatic("android.graphics.Bitmap").RunMethod("createBitmap", Array(Width, Height, "RGB_565")) End Sub B4A Question How to unload an image, to free memory. - Erel (first post)    Feb 17, 2015   (1 reaction) Create a process global mutable bitmap when the activity is first created and draw on this bitmap with Canvas.Initialize2 instead of Canvas.Initialize(iv). Set this bitmap as the ImageView background. B4A Code Snippet Draw round bitmap - Erel    Sep 04, 2016   (25 reactions) Sub Name: DrawRoundBitmap Description: This code uses Path object to draw a round bitmap at the center of a transparent mutable bitmap. Sub Activity_Create(FirstTime As Boolean) Dim cvs As Canvas = CreateBitmap DrawRoundBitmap(cvs, LoadBitmap(File.DirAssets, "1.jpg")) Activity.SetBackgro B4A Question x,y inside a path?? - JordiCP (first post)    May 31, 2016   (1 reaction) Algorithm-less tricky way Create a mutable bitmap with the same dimensions as the view you are showing. No need to attach it to a view. Initialize a canvas to it. Clip the path and fill it Red. When you want to see if X, Y is inside the path, just check the color of this point in the bitmap (Surpr B4A Question Shortcut Home Screen - Roycefer (first post)    Feb 15, 2016   (2 reactions) If you follow the code, you'll see a Bitmap created, called i. This Bitmap is initialized as mutable. Then a Canvas is created to draw on i. The icon is drawn onto the Canvas (and hence the Bitmap). Then the Bitmap is put as an Extra into the Intent "in". This Intent is what is eventually broadcast. B4A Question [SOLVED] text to picture (watermark) - roumei (first post)    Nov 22, 2020   (2 reactions) You need to make sure that the aspect ratio of the ImageView and the Image are the same.
Or you could use a mutable bitmap to preserve the original resolution and aspect ratio:
' Load bitmap
Dim bmpInput As Bitmap = LoadBitmap(File.DirAssets, "Test.jpg")
' Create a mutable bitmap a B4A Question LED sign application - JordiCP (first post)    Nov 11, 2015   (1 reaction) You should declare a bitmap, and initialize mutable with the width and height of your display. Then initialize a canvas with this bitmap (canvas.Initialize2(...)) and draw onto it. If you only want one bit per pixel, then draw only with one color Once drawn, you can get the pixels in any position Page: 1   2   3   4   5   6   7   Powered by ColBERT |